Home

Awesome

swaggerplusplus

A proposal for transitioning between Swagger 2.0 and OpenAPI 3.0.x

Version 1.0.0-rc4

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 RFC2119 RFC8174 when, and only when, they appear in all capitals, as shown here.

To aid the transition between Swagger 2.0 and OpenAPI 3.0.x, it is proposed to back-port the following features from the OpenAPI 3.0.0 specification (currently version 3.0.0) as specification extensions (formerly known as vendor extensions).

Tooling MAY make use of these features now, with minimal work required to support them in OpenAPI 3.0.x, definition authors MAY also use these features, knowing their API definition can be losslessly converted from swaggerplusplus to OpenAPI 3.0.x by any swaggerplusplus-compatible converter.

Features

PathVersion 3.0.x ObjectNew ExtensionTypeDescription
#/serversx-servers[Server Objects]When converting to OpenAPI 3.0.x, this array is used in place of any servers array converted from Swagger 2.0 metadata
#/paths/{Path Item}serversx-servers[Server Objects]
#/paths/{Path Item}/{operation}serversx-servers[Server Objects]
#/paths/{Path Item}/{Operation}tracex-traceV2 Operation ObjectThis MUST be a Swagger 2.0 Operation Object, it MUST be treated as per any other Operation Object, for the TRACE HTTP method
#/paths/{Path Item}summaryx-summaryStringAlso as per Apiary extension
#/paths/{Path Item}descriptionx-descriptionStringAlso as per Apiary extension
#/parameters OR #/paths/{Path Item}/parameters OR #/paths/{Path Item}/{Operation}/parametersdeprecatedx-deprecatedBooleanIndicates the parameter is deprecated and SHOULD be transitioned out of use
#/paths/{Path Item}/{Operation}callbacksx-callbacks[Callback Objects]
* within Schema ObjectanyOfx-anyOf[Schema Object]Schema MUST be extracted and post-processed before being used for validation
* within Schema ObjectoneOfx-oneOf[Schema Object]Schema MUST be extracted and post-processed before being used for validation
* within Schema Objectnotx-notSchema ObjectSchema MUST be extracted and post-processed before being used for validation
* within Schema Objectrequiredx-requiredArrayWhere a property has been removed from required due to use of x-anyOf, x-oneOf or x-not, converters MUST merge these arrays when converting from swaggerplusplus to OpenAPI 3.0.x. When a converter converts from 3.0.x to swaggerplusplus it MUST remove any required properties hidden by x-anyOf, x-oneOf or x-not and move them into this array.
* within Schema Objectnullablex-nullableBooleanIndicates whether the property is nullable or not.
* within Schema Objectdiscriminatorx-discriminatorDiscriminator ObjectA version 3.0.x discriminator object to replace the version 2.0 discriminator property.
* within Response Objectlinksx-linksMap {Link Object}Links or references to reusable Link Objects
#/components/linksx-linksMap {Link Object}Contains reusable Link Objects
#/components/callbacksx-callbacksMap {Callback Object}Contains reusable Callback Objects

Conversion

Converters MUST validate the specification extensions are of the expected type, and that mandatory properties (if any) are present. Failing that, they MUST leave the specification extension unchanged.

swaggerplusplus Tools

swaggerplusplus in the wild

Zappiti API