Skip to main content

Discriminator with Shared Properties and Mapping

GET 

/discriminator-shared-mapping

Schema:

type: object
discriminator:
propertyName: type
mapping:
typeA: "#/components/schemas/TypeA"
typeB: "#/components/schemas/TypeB"
properties:
type:
type: string
sharedProp:
type: string
oneOf:
- $ref: '#/components/schemas/TypeA'
- $ref: '#/components/schemas/TypeB'

Responses

Successful response

Schema

    oneOf

    type stringrequired

    Possible values: [typeA]

    propA string

    type

    string

    Possible values: [typeA, typeB]

    type stringrequired

    Possible values: [typeA]

    propA string
    sharedProp string
Loading...