Skip to content

Commit b3b47c5

Browse files
authored
Do not remove schemas with only a default value form allOf schemas
A schema with only a default was treated as "meta data only" this caused it to be removed from an allOf schema causing the default value to be lost
1 parent 3c664d1 commit b3b47c5

File tree

1 file changed

+2
-1
lines changed
  • modules/openapi-generator/src/main/java/org/openapitools/codegen/utils

1 file changed

+2
-1
lines changed

modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2358,7 +2358,8 @@ public static boolean isMetadataOnlySchema(Schema schema) {
23582358
schema.getContains() != null ||
23592359
schema.get$dynamicAnchor() != null ||
23602360
schema.get$anchor() != null ||
2361-
schema.getContentSchema() != null;
2361+
schema.getContentSchema() != null ||
2362+
schema.getDefault() != null;
23622363
}
23632364

23642365

0 commit comments

Comments
 (0)