Discriminator with Nested Schemas without Mapping
GET/discriminator-nested
Schema:
type: object
discriminator:
propertyName: type
properties:
type:
type: string
oneOf:
- $ref: '#/components/schemas/NestedTypeA'
- $ref: '#/components/schemas/NestedTypeB'
Responses
- 200
Successful response
- application/json
- Schema
- Example (from schema)
Schema
- NestedTypeA
- NestedTypeB
oneOf
type stringrequired
Possible values: [nestedTypeA
]
nestedA
object
propA1 string
propA2 number
type stringrequired
Possible values: [nestedTypeB
]
nestedB
object
propB1 string
propB2 boolean
type string
{
"type": "string"
}
Loading...