Skip to Content
openapi-proxy

OpenAPI versions

Every variant is served as OpenAPI 3.0 and 3.1. The URL says which one a reader gets.

Your framework generates one version of OpenAPI. The tools that read it do not all agree: a documentation site may want 3.1, an API gateway or an older generator may only take 3.0. So every variant is served in both, and the reader picks one with the URL.

The version is in the URL

GET /v/<project>/<variant>.json         the version your document has
GET /v/<project>/<variant>/3.0.json     OpenAPI 3.0
GET /v/<project>/<variant>/3.1.yaml     OpenAPI 3.1, as YAML

There is nothing to set up. A version is converted the first time someone asks for it and stored, like any other document the proxy serves.

A URL with a version in it keeps serving that version when your API moves to another one. Use it for a reader that only takes one version.

Without a version in it, a variant's URL serves the version your document has. A project of several documents has the highest version among them. A document that is not converted is not rewritten at all.

In the editor, the result pane shows the version next to the format, for example "OpenAPI 3.1". Open it to see where each version is served. Pick one and the preview shows that document, and the URL above it becomes the one to copy.

From 3.0 to 3.1

Nothing is lost. The few things 3.0 says its own way are said the way JSON Schema does:

In 3.0In 3.1
type: string, nullable: truetype: [string, "null"]
minimum: 5, exclusiveMinimum: trueexclusiveMinimum: 5
example: x on a schemaexamples: [x]

From 3.1 to 3.0

3.0 schemas are an older, smaller language. What has an equivalent is translated:

In 3.1In 3.0
type: [string, "null"]type: string, nullable: true
anyOf: [X, { type: "null" }]X with nullable: true
const: xenum: [x]
exclusiveMinimum: 5minimum: 5, exclusiveMinimum: true
examples: [x, y] on a schemaexample: x
a $ref with other keywords next to itallOf: [{ $ref }] with those keywords
contentMediaType: application/octet-streamformat: binary
webhooksx-webhooks, which Redoc and others read

What has no equivalent is removed: patternProperties, tuples (prefixItems), conditions (if, then, else), unevaluatedProperties and a few more. The editor says exactly what was left out of this variant and how often, so you know what a 3.0 reader will not see. Only what the variant serves is converted, so only that is reported.

What is not converted

  • Swagger 2.0 documents cannot be connected.
  • A 3.2 document is served as it is.

On this page