Skip to content

Commit 8a662a3

Browse files
committed
1 parent b9b9c20 commit 8a662a3

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

openapi-processor-core/src/main/kotlin/io/openapiprocessor/core/writer/java/DataTypeWriterBase.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ data class PropertyData(
2828
val propName: String,
2929
val baseName: String,
3030
val imports: Set<String>,
31+
val modelDataType: ModelDataType,
3132
val propDataType: PropertyDataType
3233
) {
33-
fun isRequired(dataType: ModelDataType): Boolean {
34-
return dataType.isRequired(srcPropName)
35-
}
34+
val required = modelDataType.isRequired(srcPropName)
3635
}
3736

3837

@@ -60,6 +59,7 @@ abstract class DataTypeWriterBase(
6059
propName,
6160
baseName,
6261
propImports,
62+
modelDataType,
6363
propDataType))
6464
}
6565

openapi-processor-core/src/main/kotlin/io/openapiprocessor/core/writer/java/DataTypeWriterPojo.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class DataTypeWriterPojo(
5555
propData.srcPropName,
5656
propData.propName,
5757
propData.propDataType,
58-
propData.isRequired(dataType),
58+
propData.required,
5959
Access.PRIVATE)
6060

6161
// null (JsonNullable) may have an init value

openapi-processor-core/src/main/kotlin/io/openapiprocessor/core/writer/java/DataTypeWriterRecord.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class DataTypeWriterRecord(
4848
propData.srcPropName,
4949
propData.propName,
5050
propData.propDataType,
51-
propData.isRequired(dataType),
51+
propData.required,
5252
Access.NONE)
5353

5454
// todo can't init record parameter here

0 commit comments

Comments
 (0)