Added discriminator.mapping
Sergey Mischenko
Branch: MischenkoSV/swagger-request-validator:v2.0
Branch: atlassian/swagger-request-validator:v2.0
Merged
Merged pull request
Merged in MischenkoSV/swagger-request-validator/v2.0 (pull request #82)
Merged in MischenkoSV/swagger-request-validator/v2.0 (pull request #82)
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#discriminator-object
components: schemas: Pet: type: object required: - pet_type properties: pet_type: type: string discriminator: propertyName: pet_type mapping: cachorro: Dog Cat: allOf: - $ref: '#/components/schemas/Pet' - type: object # all other properties specific to a `Cat` properties: name: type: string Dog: allOf: - $ref: '#/components/schemas/Pet' - type: object # all other properties specific to a `Dog` properties: bark: type: string Lizard: allOf: - $ref: '#/components/schemas/Pet' - type: object # all other properties specific to a `Lizard` properties: lovesRocks: type: boolean
Valid value
{ "pet_type": "cachorro", "bark": "soft" }
Â