"discriminator" in polymorphism, OpenAPI 2.0 (Swagger 2.0 ...
stackoverflow.com › questions › 39683846Sep 25, 2016 · Assumes that there are tools that can proper support definition objects with the use of discriminator, it is possible to determine the type by scanning the property. For example, identify the object is a Cat according to petType. However, the discriminator field is not well defined in the current version's specification or the samples (see issue #403). As far as I know, there is no tools provided by Swagger properly support it at the time being.
Inheritance and Polymorphism - Swagger
swagger.io › docs › specificationOne possible example are code generation tools: they can use discriminator to generate program statements that typecast request data to appropriate object type based on the discriminator property value. Mapping Type Names It is implied, that the property to which discriminator refers, contains the name of the target schema.
OpenAPI Specification - Version 3.0.3 | Swagger
https://swagger.io/specificationFor example, a valid OpenAPI 3.0.2 ... (OAS 2.0 documents contain a top-level version field named swagger and value "2.0 ... object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based ...