@@ -391,7 +391,7 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
391
391
}
392
392
393
393
List <Class <?>> composedSchemaReferencedClasses = getComposedSchemaReferencedClasses (type .getRawClass (), annotatedType .getCtxAnnotations (), resolvedSchemaAnnotation );
394
- boolean isComposedSchema = composedSchemaReferencedClasses != null ;
394
+ boolean hasCompositionKeywords = composedSchemaReferencedClasses != null ;
395
395
396
396
if (isPrimitive ) {
397
397
XML xml = resolveXml (beanDesc .getClassInfo (), annotatedType .getCtxAnnotations (), resolvedSchemaAnnotation );
@@ -418,7 +418,7 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
418
418
model = openapi31 ? new JsonSchema () : new Schema ();
419
419
model .$ref (Components .COMPONENTS_SCHEMAS_REF + name );
420
420
}
421
- if (!isComposedSchema ) {
421
+ if (!hasCompositionKeywords ) {
422
422
if (schemaRefFromAnnotation != null && model != null ) {
423
423
model .raw$ref (schemaRefFromAnnotation );
424
424
}
@@ -464,7 +464,7 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
464
464
465
465
if (type .isContainerType ()) {
466
466
// TODO currently a MapSchema or ArraySchema don't also support composed schema props (oneOf,..)
467
- isComposedSchema = false ;
467
+ hasCompositionKeywords = false ;
468
468
JavaType keyType = type .getKeyType ();
469
469
JavaType valueType = type .getContentType ();
470
470
String pName = null ;
@@ -593,7 +593,7 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
593
593
return null ;
594
594
}
595
595
}
596
- } else if (isComposedSchema ) {
596
+ } else if (hasCompositionKeywords ) {
597
597
model = openapi31 ? new JsonSchema () : new ComposedSchema ();
598
598
model .name (name );
599
599
if (
@@ -1041,9 +1041,9 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
1041
1041
}
1042
1042
}
1043
1043
1044
- if (isComposedSchema ) {
1044
+ if (hasCompositionKeywords ) {
1045
1045
1046
- ComposedSchema composedSchema = ( ComposedSchema ) model ;
1046
+ Schema schemaWithCompositionKeys = model ;
1047
1047
1048
1048
Class <?>[] allOf = resolvedSchemaAnnotation .allOf ();
1049
1049
Class <?>[] anyOf = resolvedSchemaAnnotation .anyOf ();
@@ -1061,12 +1061,12 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
1061
1061
refSchema = allOfRef ;
1062
1062
}
1063
1063
// allOf could have already being added during subtype resolving
1064
- if (composedSchema .getAllOf () == null || !composedSchema .getAllOf ().contains (refSchema )) {
1065
- composedSchema .addAllOfItem (refSchema );
1064
+ if (schemaWithCompositionKeys .getAllOf () == null || !schemaWithCompositionKeys .getAllOf ().contains (refSchema )) {
1065
+ schemaWithCompositionKeys .addAllOfItem (refSchema );
1066
1066
}
1067
1067
// remove shared properties defined in the parent
1068
1068
if (isSubtype (beanDesc .getClassInfo (), c )) {
1069
- removeParentProperties (composedSchema , allOfRef );
1069
+ removeParentProperties (schemaWithCompositionKeys , allOfRef );
1070
1070
}
1071
1071
});
1072
1072
@@ -1079,14 +1079,14 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
1079
1079
Schema anyOfRef = context .resolve (new AnnotatedType ().components (annotatedType .getComponents ()).type (c ).jsonViewAnnotation (annotatedType .getJsonViewAnnotation ()));
1080
1080
if (anyOfRef != null ) {
1081
1081
if (StringUtils .isNotBlank (anyOfRef .getName ())) {
1082
- composedSchema .addAnyOfItem (new Schema ().$ref (Components .COMPONENTS_SCHEMAS_REF + anyOfRef .getName ()));
1082
+ schemaWithCompositionKeys .addAnyOfItem (new Schema ().$ref (Components .COMPONENTS_SCHEMAS_REF + anyOfRef .getName ()));
1083
1083
} else {
1084
- composedSchema .addAnyOfItem (anyOfRef );
1084
+ schemaWithCompositionKeys .addAnyOfItem (anyOfRef );
1085
1085
}
1086
1086
}
1087
1087
// remove shared properties defined in the parent
1088
1088
if (isSubtype (beanDesc .getClassInfo (), c )) {
1089
- removeParentProperties (composedSchema , anyOfRef );
1089
+ removeParentProperties (schemaWithCompositionKeys , anyOfRef );
1090
1090
}
1091
1091
1092
1092
});
@@ -1100,25 +1100,25 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
1100
1100
Schema oneOfRef = context .resolve (new AnnotatedType ().components (annotatedType .getComponents ()).type (c ).jsonViewAnnotation (annotatedType .getJsonViewAnnotation ()));
1101
1101
if (oneOfRef != null ) {
1102
1102
if (StringUtils .isBlank (oneOfRef .getName ())) {
1103
- composedSchema .addOneOfItem (oneOfRef );
1103
+ schemaWithCompositionKeys .addOneOfItem (oneOfRef );
1104
1104
} else {
1105
- composedSchema .addOneOfItem (new Schema ().$ref (Components .COMPONENTS_SCHEMAS_REF + oneOfRef .getName ()));
1105
+ schemaWithCompositionKeys .addOneOfItem (new Schema ().$ref (Components .COMPONENTS_SCHEMAS_REF + oneOfRef .getName ()));
1106
1106
}
1107
1107
// remove shared properties defined in the parent
1108
1108
if (isSubtype (beanDesc .getClassInfo (), c )) {
1109
- removeParentProperties (composedSchema , oneOfRef );
1109
+ removeParentProperties (schemaWithCompositionKeys , oneOfRef );
1110
1110
}
1111
1111
}
1112
1112
1113
1113
});
1114
1114
1115
1115
if (!composedModelPropertiesAsSibling ) {
1116
- if (composedSchema .getAllOf () != null && !composedSchema .getAllOf ().isEmpty ()) {
1117
- if (composedSchema .getProperties () != null && !composedSchema .getProperties ().isEmpty ()) {
1116
+ if (schemaWithCompositionKeys .getAllOf () != null && !schemaWithCompositionKeys .getAllOf ().isEmpty ()) {
1117
+ if (schemaWithCompositionKeys .getProperties () != null && !schemaWithCompositionKeys .getProperties ().isEmpty ()) {
1118
1118
Schema propSchema = openapi31 ? new JsonSchema ().typesItem ("object" ) : new ObjectSchema ();
1119
- propSchema .properties (composedSchema .getProperties ());
1120
- composedSchema .setProperties (null );
1121
- composedSchema .addAllOfItem (propSchema );
1119
+ propSchema .properties (schemaWithCompositionKeys .getProperties ());
1120
+ schemaWithCompositionKeys .setProperties (null );
1121
+ schemaWithCompositionKeys .addAllOfItem (propSchema );
1122
1122
}
1123
1123
}
1124
1124
}
@@ -1139,7 +1139,7 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
1139
1139
Schema .SchemaResolution resolvedSchemaResolution = AnnotationsUtils .resolveSchemaResolution (this .schemaResolution , resolvedSchemaAnnotation );
1140
1140
1141
1141
if (model != null && annotatedType .isResolveAsRef () &&
1142
- (isComposedSchema || isObjectSchema (model ) || implicitObject ) &&
1142
+ (hasCompositionKeywords || isObjectSchema (model ) || implicitObject ) &&
1143
1143
StringUtils .isNotBlank (model .getName ())) {
1144
1144
if (context .getDefinedModels ().containsKey (model .getName ())) {
1145
1145
if (!Schema .SchemaResolution .INLINE .equals (resolvedSchemaResolution )) {
0 commit comments