Skip to content

Instantly share code, notes, and snippets.

@cari-lynn
Created August 24, 2021 03:32
Show Gist options
  • Save cari-lynn/bc35270734e41ea17947e2f43a631494 to your computer and use it in GitHub Desktop.
Save cari-lynn/bc35270734e41ea17947e2f43a631494 to your computer and use it in GitHub Desktop.
OpenAPI 3.1.0 and 3.0.x differences

OpenAPI 3.1.0 and 3.0.x Comparison

3.1.0

  • Released Feb 2021
  • Schema Object uses JSON Schema Specification Draft 2020-12
  • Has full compatibility with modern JSON Schema
  • Supports multiple examples in a Schema Object

3.0.x

  • 3.0.3 released Feburary 2020 (3.0.0 released 2017)
  • Schema Object uses JSON Schema Specification Draft 2019-09
  • "subset superset" of JsonSchema, and has many differences with JsonSchema
  • Supports single example in a Schema Object

Considerations

  • 3.0.x requires an extra top level key paths that ytt will not need
  • Supported types are different between the two specs, but both should work with ytt supported types
  • Both can do everything ytt needs:
    • Allow values to be null
    • Allow multiple types (anyOf)
    • Allows all types ytt uses (string, boolean, collections, integers)

What version other tools use

The site openapi.tools lists tools that validate APIs, validate OpenAPI Docs, and generate Documentation, and very few support 3.1.0, almost all support 3.0.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment