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.