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
- 200
Successful response
- application/json
- Schema
- Example (from schema)
Schema
- typeA
- typeB
- TypeA
- TypeB
type
string
Possible values: [typeA
, typeB
]
type stringrequired
Possible values: [typeA
]
propA string
type stringrequired
Possible values: [typeB
]
propB number
oneOf
type stringrequired
Possible values: [typeA
]
propA string
type stringrequired
Possible values: [typeB
]
propB number
sharedProp string
{
"type": "typeA",
"sharedProp": "string",
"propA": "string"
}
Loading...