Skip to main content

Discriminator with Nested Schemas and Mapping

GET 

/discriminator-nested-mapping

Schema:

type: object
discriminator:
propertyName: type
mapping:
nestedTypeA: "#/components/schemas/NestedTypeA"
nestedTypeB: "#/components/schemas/NestedTypeB"
properties:
type:
type: string
oneOf:
- $ref: '#/components/schemas/NestedTypeA'
- $ref: '#/components/schemas/NestedTypeB'

Responses

Successful response