I've seen an example of a polymorphic array in the docs:
@ApiProperty({
type: 'array',
items: {
oneOf: [
{ $ref: getSchemaPath(Cat) },
{ $ref: getSchemaPath(Dog) },
],
},
})
pets: Cat | Dog;
However in my cats I'm not looking for an array of Cats or Dogs but rather an array of Cats OR an array of Dogs. Does anyone know how to do this? I tried:
@ApiProperty({
oneOf: [
{
type: 'array',
items: {
$ref: getSchemaPath(Cat)
}
},
{
type: 'array',
items: {
$ref: getSchemaPath(Dog)
}
}
]
})
pets: Cat[] | Dog[];
But the generated docs just show
{
pets: [
"string"
]
}
Thanks