Skip to content

Commit 4c76d10

Browse files
committed
add comment to explain that behavior around default is undefined in open api spec
1 parent ea9937a commit 4c76d10

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,8 @@ public static Object resolveDefault(OpenAPI openAPI, Schema<?> schema) {
10561056
// recursive search for default
10571057
.map(item -> resolveDefault(openAPI, item))
10581058
.filter(Objects::nonNull)
1059+
// first non-null default in allOf wins.
1060+
// This is very arbitrary and might not be correct behavior, since behavior regarding default inheritance/overriding is unspecified
10591061
.findFirst()
10601062
.orElse(null);
10611063
}

0 commit comments

Comments
 (0)