Basic Structure - Swagger
swagger.io › docs › specificationEvery Swagger specification starts with the Swagger version, 2.0 being the latest version. A Swagger version defines the overall structure of an API specification – what you can document and how you document it. swagger: "2.0" Then, you need to specify the API info – title, description (optional), version (API version, not file revision or ...
Basic Structure - Swagger
https://swagger.io/docs/specification/2-0OAS 2 This page applies to OpenAPI Specification ver. 2 (fka Swagger). To learn about the latest version, visit OpenAPI 3 pages.. Basic Structure Swagger definitions can be written in JSON or YAML.In this guide, we only use YAML examples, but JSON works equally well.
Inheritance and Polymorphism - Swagger
swagger.io › docs › specificationOAS 3 This guide is for OpenAPI 3.0.. Inheritance and Polymorphism Model Composition In your API, you may have model schemas that share common properties. Instead of describing these properties for each schema repeatedly, you can describe the schemas as a composition of the common property set and schema-specific properties.
AutoRest Extensions for OpenAPI 2.0 | autorest
azure.github.io/autorest/extensionsx-ms-discriminator-value Swagger 2.0 specification requires that when used, the value of discriminator field MUST match the name of the schema or any schema that inherits it. To overcome this limitation x-ms-discriminator-value extension was introduced. Schema : string - the expected value of the discriminator field on the wire.
Using the OpenAPI discriminator - Redocly
redoc.ly › docs › resourcesDiscriminator is described inline. The discriminator must use anyOf, oneOf or allOf. When you define it inline, for example, as I did on a version of the ElectricVehicle schema below, it ignores that schema (per the spec): When using the discriminator, inline schemas will not be considered.