0

Swagger docs say that we can use a complex type object specified as array type as follows:

"type": "array",
  "items": {
    "$ref": "#/components/schemas/VeryComplexType"
}

But what if you have an array of different complex types (e.g. country, address, etc.) ? When trying to pass multiple $ref as follows:

"type": "array",
  "items": {
    "$ref": "#/components/schemas/VeryComplexType-1"
    "$ref": "#/components/schemas/VeryComplexType-2"
    "$ref": "#/components/schemas/VeryComplexType-3"
}

raises an error:

warning: key :$ref is duplicated and overwritten on line 245
warning: key :$ref is duplicated and overwritten on line 246

and it keeps the last one only. How is ti possible to fix that (if it is) ?

Thank you.

belgoros
  • 3,590
  • 7
  • 38
  • 76

1 Answers1

0

It is available starting from Open API 3.0 and it was discussed at this issue.

As rswag supports Swagger 2.0 only, it is not possible.

belgoros
  • 3,590
  • 7
  • 38
  • 76