@@ -140,12 +140,6 @@ public ObjectMapper objectMapper() {
140140
141141 @ Override
142142 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 )));
149143 boolean isPrimitive = false ;
150144 Schema model = null ;
151145 List <String > requiredProps = new ArrayList <>();
@@ -477,7 +471,7 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
477471 }
478472 if (isObjectSchema (addPropertiesSchema ) && pName != null ) {
479473 if (context .getDefinedModels ().containsKey (pName )) {
480- if (Schema .SchemaResolution .INLINE .equals (containerResolvedSchemaResolution ) && applySchemaResolution ) {
474+ if (Schema .SchemaResolution .INLINE .equals (containerResolvedSchemaResolution ) && applySchemaResolution () ) {
481475 addPropertiesSchema = context .getDefinedModels ().get (pName );
482476 } else {
483477 // create a reference for the items
@@ -529,7 +523,7 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
529523 }
530524 if (isObjectSchema (items ) && pName != null ) {
531525 if (context .getDefinedModels ().containsKey (pName )) {
532- if (Schema .SchemaResolution .INLINE .equals (containerResolvedSchemaResolution ) && applySchemaResolution ) {
526+ if (Schema .SchemaResolution .INLINE .equals (containerResolvedSchemaResolution ) && applySchemaResolution () ) {
533527 items = context .getDefinedModels ().get (pName );
534528 } else {
535529 // create a reference for the items
@@ -751,7 +745,7 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
751745 property = context .resolve (aType );
752746 property = clone (property );
753747 Schema ctxProperty = null ;
754- if (!applySchemaResolution ) {
748+ if (!applySchemaResolution () ) {
755749 Optional <Schema > reResolvedProperty = AnnotationsUtils .getSchemaFromAnnotation (ctxSchema , annotatedType .getComponents (), null , openapi31 , property , schemaResolution , context );
756750 if (reResolvedProperty .isPresent ()) {
757751 property = reResolvedProperty .get ();
@@ -835,7 +829,7 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
835829 }
836830 }
837831 } else if (property .get$ref () != null ) {
838- if (applySchemaResolution ) {
832+ if (applySchemaResolution () ) {
839833 if (Schema .SchemaResolution .ALL_OF .equals (resolvedSchemaResolution ) && ctxProperty != null ) {
840834 property = new Schema ()
841835 .addAllOfItem (ctxProperty )
@@ -3126,4 +3120,10 @@ protected Schema buildRefSchemaIfObject(Schema schema, ModelConverterContext con
31263120 }
31273121 return result ;
31283122 }
3123+
3124+ protected boolean applySchemaResolution () {
3125+ return !openapi31 ||
3126+ (Boolean .parseBoolean (System .getProperty (Schema .APPLY_SCHEMA_RESOLUTION_PROPERTY , "false" )) ||
3127+ Boolean .parseBoolean (System .getenv (Schema .APPLY_SCHEMA_RESOLUTION_PROPERTY )));
3128+ }
31293129}
0 commit comments