Added discriminator.mapping

Merged
#82 · Created  · Last updated

Merged pull request

Merged in MischenkoSV/swagger-request-validator/v2.0 (pull request #82)

1704d6f·Author: ·Closed by: ·2018-07-04

Description

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" }

 

0 attachments

0 comments

Loading commits...