Skip to content

Commit 6b039e8

Browse files
committed
added method to check is schema is nullable
1 parent a39ea6f commit 6b039e8

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/v3/CodegenConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case,
251251
public static final String HAS_INNER_OBJECT_NAME = PREFIX_HAS + "inner-object";
252252

253253
public static final String IS_SIMPLE_TYPE_EXT_NAME = PREFIX_IS + "simple-type";
254+
public static final String IS_NULLABLE_EXT_NAME = PREFIX_IS + "nullable";
254255
public static final String IS_PRIMITIVE_TYPE_EXT_NAME = PREFIX_IS + "primitive-type";
255256
public static final String IS_OBJECT_EXT_NAME = PREFIX_IS + "object";
256257
public static final String IS_CONTAINER_EXT_NAME = PREFIX_IS + "container";

modules/swagger-codegen/src/main/java/io/swagger/codegen/v3/CodegenObject.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ public Boolean getIsReadOnly() {
136136
return getBooleanValue(CodegenConstants.IS_READ_ONLY_EXT_NAME);
137137
}
138138

139+
public Boolean getIsNullable() {
140+
return getBooleanValue(CodegenConstants.IS_NULLABLE_EXT_NAME);
141+
}
142+
139143
public Boolean getIsCollectionFormatMulti() {
140144
return getBooleanValue(CodegenConstants.IS_COLLECTION_FORMAT_MULTI_EXT_NAME);
141145
}

0 commit comments

Comments
 (0)