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

Clarify semantics of omitting vocabularies from "$vocabulary" #1294

Closed
handrews opened this issue Sep 18, 2022 · 0 comments · Fixed by #1295
Closed

Clarify semantics of omitting vocabularies from "$vocabulary" #1294

handrews opened this issue Sep 18, 2022 · 0 comments · Fixed by #1295
Assignees
Labels
clarification Items that need to be clarified in the specification core
Milestone

Comments

@handrews
Copy link
Contributor

Per the §8.1.2 of the core spec:

The "$vocabulary" keyword is used in meta-schemas to identify the vocabularies available for use in schemas described by that meta-schema. It is also used to indicate whether each vocabulary is required or optional, in the sense that an implementation MUST understand the required vocabularies in order to successfully process the schema. Together, this information forms a dialect. Any vocabulary that is understood by the implementation MUST be processed in a manner consistent with the semantic definitions contained within the vocabulary.

The intent of "identify the vocabularies available for use" is that schemas not identified as available for use are not available for use. We have do have a test for this scenario.

Supporting points for this view include:

  • There wouldn't be a need for optional vocabularies if omitting a vocabulary still allowed you to use it
  • There wouldn't be a need for the introduction of §8 to discuss handling of both omitting the core vocabulary and including it as optional, with the recommendation to raise an error in such cases, if omitting it had no effect.

An exhaustive discussion of further historical details, complete with citations from old issue and PR discussions, can be found in json-schema-org/JSON-Schema-Test-Suite#574

We just need to add normative language around the omission aspect. A related clarification (also discussed in the linked test suite issue) is that non-vocabulary keywords of the same name as vocabulary keywords are not considered the same keyword, any more than identically named keywords in different vocabularies are. They can be distinguished by whether inclusion in or omission from $vocabulary has an effect on them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Items that need to be clarified in the specification core
Development

Successfully merging a pull request may close this issue.

2 participants