@@ -397,15 +397,15 @@ private void processNestedSchemas(Schema schema, Set<Schema> visitedSchemas) {
397
397
if (ModelUtils .isMapSchema (schema ) && ModelUtils .getAdditionalProperties (schema ) != null ) {
398
398
Schema mapValueSchema = ModelUtils .getAdditionalProperties (schema );
399
399
mapValueSchema = ModelUtils .getReferencedSchema (openAPI , mapValueSchema );
400
- if (ModelUtils .isArraySchema (mapValueSchema ) || ModelUtils .isMapSchema (mapValueSchema )) {
400
+ if (ModelUtils .isArraySchema (mapValueSchema ) || (! ModelUtils .isMapSchema (mapValueSchema ) && ! ModelUtils . isModel ( mapValueSchema ) )) {
401
401
Schema innerSchema = generateNestedSchema (mapValueSchema , visitedSchemas );
402
402
schema .setAdditionalProperties (innerSchema );
403
403
404
404
}
405
405
} else if (ModelUtils .isArraySchema (schema ) && ModelUtils .getSchemaItems (schema ) != null ) {
406
406
Schema arrayItemSchema = ModelUtils .getSchemaItems (schema );
407
407
arrayItemSchema = ModelUtils .getReferencedSchema (openAPI , arrayItemSchema );
408
- if (ModelUtils .isMapSchema (arrayItemSchema ) || ModelUtils .isArraySchema (arrayItemSchema )) {
408
+ if (( ModelUtils .isMapSchema (arrayItemSchema ) && ! ModelUtils . isModel ( arrayItemSchema ) ) || ModelUtils .isArraySchema (arrayItemSchema )) {
409
409
Schema innerSchema = generateNestedSchema (arrayItemSchema , visitedSchemas );
410
410
schema .setItems (innerSchema );
411
411
}
@@ -418,7 +418,7 @@ private void processNestedSchemas(Schema schema, Set<Schema> visitedSchemas) {
418
418
Schema innerSchema = generateNestedSchema (oneOfSchema , visitedSchemas );
419
419
innerSchema .setTitle (oneOf .getTitle ());
420
420
newOneOfs .add (innerSchema );
421
- } else if (ModelUtils .isMapSchema (oneOfSchema )) {
421
+ } else if (ModelUtils .isMapSchema (oneOfSchema ) && ! ModelUtils . isModel ( oneOfSchema ) ) {
422
422
Schema innerSchema = generateNestedSchema (oneOfSchema , visitedSchemas );
423
423
innerSchema .setTitle (oneOf .getTitle ());
424
424
newOneOfs .add (innerSchema );
0 commit comments