Skip to main content

Discriminator with AllOf and Mapping

GET 

/discriminator-allof-mapping

Schema:

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

Responses

Successful response

Schema

    type

    string

    Possible values: [typeA, typeB]

    type stringrequired

    Possible values: [typeA]

    propA string

    oneOf

    type stringrequired

    Possible values: [typeA]

    propA string
    sharedProp string
Loading...