Documentation
¶
Overview ¶
Package stdopenapi works with OpenAPI documents.
Index ¶
Constants ¶
const DownConvertVersion = "3.0.3"
DownConvertVersion is the OpenAPI version that DownConvert produces.
Variables ¶
This section is empty.
Functions ¶
func DownConvert ¶
DownConvert converts an OpenAPI 3.1 document, in YAML or JSON, to an OpenAPI 3.0.3 document in YAML, for clients that do not support 3.1. It rewrites the 3.1 constructs that have a 3.0 equivalent:
- a type list with "null", such as [string, "null"], becomes the type and nullable: true;
- a schema's examples become its first example;
- const becomes an enum of one value;
- a numeric exclusiveMinimum or exclusiveMaximum becomes minimum or maximum, with the boolean exclusiveMinimum or exclusiveMaximum;
- a $ref with sibling keywords becomes an allOf of the $ref, next to the siblings, since OpenAPI 3.0 ignores the siblings of a $ref;
- a boolean unevaluatedProperties is dropped: OpenAPI 3.0 cannot close an object over the properties of its allOf, anyOf, or oneOf, so the object accepts other properties too. protoc-gen-connect-openapi writes unevaluatedProperties: false for messages with a oneof.
It fails on the 3.1 constructs that OpenAPI 3.0 cannot express, such as webhooks, prefixItems, or a type list of several types, and reports where each one is, instead of dropping them. It keeps the order of keys, and writes mappings and sequences in block style.
It follows the rules of Apiture's openapi-down-convert (https://github.com/apiture/openapi-down-convert) where both convert a construct, but fails where that tool drops one. For more parity, it could also drop the constructs that only document: the summary and description next to a $ref, info.summary, info.license.identifier, $id and $schema, and $comment, which that tool renames to x-comment. And it could convert contentEncoding: base64 to format: byte, and contentMediaType to format: binary.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
stdopenapi-downconvert
command
Command stdopenapi-downconvert converts an OpenAPI 3.1 document to OpenAPI 3.0.3, for clients that do not support 3.1.
|
Command stdopenapi-downconvert converts an OpenAPI 3.1 document to OpenAPI 3.0.3, for clients that do not support 3.1. |