Skip to content

OpenAPI v3.1 as a JSON Schema "Vocabulary"#1957

Closed
philsturgeon wants to merge 9 commits into
OAI:v3.1.0-devfrom
philsturgeon:json-schema-vocab
Closed

OpenAPI v3.1 as a JSON Schema "Vocabulary"#1957
philsturgeon wants to merge 9 commits into
OAI:v3.1.0-devfrom
philsturgeon:json-schema-vocab

Conversation

@philsturgeon

@philsturgeon philsturgeon commented Jun 21, 2019

Copy link
Copy Markdown
Contributor

As a follow-up to the June 13th TSC call, I am working on showing you what OpenAPI v3.1 on "JSON Schema Draft 8" could look like. The WIP JSON Schema draft added a fantastic new feature called vocabularies, which allow for extension languages like OpenAPI to add their own keywords.

Basically, instead of the OpenAPI spec listing out every single similarity and difference in its subset superset sideset confusing situation, OpenAPI just extends the JSON Schema core and valaidation vocabs and adds a few keywords of its own.

This solves the OpenAPI <≠> JSON Schema divergence nicely. The biggest thing here is explaining how exclusiveMinimum and exclusiveMaximum are different from latest JSON Schema, which was done to support BC between v3.0 and v3.1.

The most controversial part of this is my choice to mark things like nullable: true and example as deprecated. This can certainly be removed, but I think it would be a good idea to start pushing folks towards one way of doing things instead of two.

Timeline for removal would essentially be maybe v4.0, or v5.0, or never, but deprecation itself is a good way to move folks in the right direction, and allow tooling to start giving warnings.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants