mikunn / openapi-schema-to-json-schema

Converts OpenAPI Schema Object to JSON Schema
76 stars 6 forks source link

Support for JSON Schema draft 5 (aka Wright 00) #28

Open Shockolate opened 6 years ago

Shockolate commented 6 years ago

The OpenAPI Specification v3.0.1 's Schema Object is an extended subset of the JSON Schema Specification Wright Draft 00 (a.k.a. draft 5).

The current converter creates Draft 4 Schemas.

I'd be ok with just bumping the hard coded draft4 url.

ehmicky commented 6 years ago

Please note that while OpenAPI 3 uses JSON schema 5, OpenAPI 2 uses JSON schema 4.

They are so similar that only changing $schema url is enough as you say. However this might require adding an option to specify which OpenAPI schema is used in input.

philsturgeon commented 5 years ago

They're technically the same, it was just a failed attempt at rewriting the metaschemas, so you can change the $schema URI with no other meaningful fork needing to be done.