@@ -140,12 +140,6 @@ public ObjectMapper objectMapper() {
140
140
141
141
@ Override
142
142
public Schema resolve (AnnotatedType annotatedType , ModelConverterContext context , Iterator <ModelConverter > next ) {
143
-
144
-
145
- boolean applySchemaResolution =
146
- !openapi31 ||
147
- (Boolean .parseBoolean (System .getProperty (Schema .APPLY_SCHEMA_RESOLUTION_PROPERTY , "false" )) ||
148
- Boolean .parseBoolean (System .getenv (Schema .APPLY_SCHEMA_RESOLUTION_PROPERTY )));
149
143
boolean isPrimitive = false ;
150
144
Schema model = null ;
151
145
List <String > requiredProps = new ArrayList <>();
@@ -477,7 +471,7 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
477
471
}
478
472
if (isObjectSchema (addPropertiesSchema ) && pName != null ) {
479
473
if (context .getDefinedModels ().containsKey (pName )) {
480
- if (Schema .SchemaResolution .INLINE .equals (containerResolvedSchemaResolution ) && applySchemaResolution ) {
474
+ if (Schema .SchemaResolution .INLINE .equals (containerResolvedSchemaResolution ) && applySchemaResolution () ) {
481
475
addPropertiesSchema = context .getDefinedModels ().get (pName );
482
476
} else {
483
477
// create a reference for the items
@@ -529,7 +523,7 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
529
523
}
530
524
if (isObjectSchema (items ) && pName != null ) {
531
525
if (context .getDefinedModels ().containsKey (pName )) {
532
- if (Schema .SchemaResolution .INLINE .equals (containerResolvedSchemaResolution ) && applySchemaResolution ) {
526
+ if (Schema .SchemaResolution .INLINE .equals (containerResolvedSchemaResolution ) && applySchemaResolution () ) {
533
527
items = context .getDefinedModels ().get (pName );
534
528
} else {
535
529
// create a reference for the items
@@ -751,7 +745,7 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
751
745
property = context .resolve (aType );
752
746
property = clone (property );
753
747
Schema ctxProperty = null ;
754
- if (!applySchemaResolution ) {
748
+ if (!applySchemaResolution () ) {
755
749
Optional <Schema > reResolvedProperty = AnnotationsUtils .getSchemaFromAnnotation (ctxSchema , annotatedType .getComponents (), null , openapi31 , property , schemaResolution , context );
756
750
if (reResolvedProperty .isPresent ()) {
757
751
property = reResolvedProperty .get ();
@@ -835,7 +829,7 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
835
829
}
836
830
}
837
831
} else if (property .get$ref () != null ) {
838
- if (applySchemaResolution ) {
832
+ if (applySchemaResolution () ) {
839
833
if (Schema .SchemaResolution .ALL_OF .equals (resolvedSchemaResolution ) && ctxProperty != null ) {
840
834
property = new Schema ()
841
835
.addAllOfItem (ctxProperty )
@@ -3123,4 +3117,10 @@ protected Schema buildRefSchemaIfObject(Schema schema, ModelConverterContext con
3123
3117
}
3124
3118
return result ;
3125
3119
}
3120
+
3121
+ protected boolean applySchemaResolution () {
3122
+ return !openapi31 ||
3123
+ (Boolean .parseBoolean (System .getProperty (Schema .APPLY_SCHEMA_RESOLUTION_PROPERTY , "false" )) ||
3124
+ Boolean .parseBoolean (System .getenv (Schema .APPLY_SCHEMA_RESOLUTION_PROPERTY )));
3125
+ }
3126
3126
}
0 commit comments