Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0.2: Advertises support for JSON Schema Draft-05 despite advice to the contrary. #2049

Closed
Capstan opened this issue Oct 31, 2019 · 5 comments

Comments

@Capstan
Copy link
Contributor

Capstan commented Oct 31, 2019

re: http://json-schema.org/draft-06/json-schema-release-notes.html#q-what-happened-to-draft-05

schema.json correctly references Draft-04 in its $schema property, but the spec's Data Types section says that they're based on JSON Schema Specification Wright Draft 00. The JSON Schema org specifically advises not to implement or advertise support for this draft.

If OpenAPI doesn't use anything specific from Draft-05, I would suggest amending the spec to just refer to Draft-04 and bring it in-line with the use from the published schema.

Related to #1032.

@Relequestual
Copy link
Contributor

Relequestual commented Oct 31, 2019

It says based on.
They also detail the differences.

Is there a specific problem this is causing you here or are you just thinking about semantics?

Sorry if I'm sounding difficult here. OAS is already looking to move to JSON Schema draft 2019-09 full support for 3.1. I'm not sure what the gain would be on resolving this issue.

@Capstan
Copy link
Contributor Author

Capstan commented Oct 31, 2019

Just semantics. If you want to resolve in 3.1 and close this as Won't Fix, that seems reasonable to me. I was just chasing down what seemed like disparities between the spec and its use in Kubernetes.

@Relequestual
Copy link
Contributor

OK. I think this is likely to be resolved before 3.1.
Think of draft-5 as a clarification on some ambiguities in darft-4. It's meant to be functionally the same, hence we don't want anyone (now) to implement it, which would suggest there were differences.

@handrews
Copy link
Member

@Capstan several things (I'm another of the JSON Schema editors, and I work with the OpenAPI Technical Steering Council on convergence between JSON Schema and the OpenAPI Specification):

  • The correct meta-schema for draft-wright-json-schema*-00 is the draft-04 schema. There are no meta-schema-level changes between the draft-04 core and validation specs and those. There will never be a draft-05 document on json-schema.org because if there were, someone would attempt to implement it separately, which would be bad. Even if it worked as a redirect, that would imply that the URI was usable, and it explicitly is not. It also expired several years ago, and everyone else who is still actively implementing JSON Schema has moved on anyway.

  • The OAS Schema Object forbids $schema, so there is nowhere that a draft-05 meta-schema URI could possibly be used even if it existed.

  • The OpenAPI TSC is well aware of this issue, it was discussed between them and us (JSON Schema project) at the time, and was at that point the only available way to reference a non-expired IETF draft and a usable meta-schema. It's not ideal, but it was the only thing that fit the requirements. (I'm glossing over some things, but those things are not worth re-opening)

  • The JSON Schema draft cannot be changed in an OAS 3.0.x patch release due to versioning constraints.

  • OAS 3.1 will move to JSON Schema draft 2019-09 with full compatibility (the OAS 3.1 Schema Object will support a superset of JSON Schema 2019-09, and Schema Objects that only use 2019-09 features will behave identically to regular JSON Schema). See Update Schema Objects to JSON Schema Draft 2019-09 #1977 for details, as well as Add proposal to clarify nullable #2050 and Resolved undocumented nullable behavior #2046 for related work in 3.0.3 ensuring a proper migration path.

So nothing is going to be done with this that isn't already being done, and I recommend that you or the TSC close this (@Relequestual and I cannot as this is not our repo) and just keep an eye on 3.1 via the referenced issues and PRs, and the overall 3.1 tracking issue #2025.

@Capstan
Copy link
Contributor Author

Capstan commented Nov 1, 2019

@handrews Thanks so much for the detailed reply! I'll close this out.

Wrt the OAS Schema Object, I had not thought to use it in an instance of said object, but simply in the schema.json that represents OAS itself. But that's moot given the other advice around not to use draft-5.

@Capstan Capstan closed this as completed Nov 1, 2019
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

No branches or pull requests

3 participants