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

Support extra keywords in a vocabulary #115

Open
gregsdennis opened this issue Sep 22, 2022 · 1 comment
Open

Support extra keywords in a vocabulary #115

gregsdennis opened this issue Sep 22, 2022 · 1 comment

Comments

@gregsdennis
Copy link

gregsdennis commented Sep 22, 2022

Hello.

I've noticed from the docs that this library supports a multitude of custom keywords. Vocabularies were introduced with draft 2019-09 (which this library supports) to manage custom keywords.

Additionally, many (if not all) of them start with a $ (e.g. $data). This is specifically recommended against.

While the "$" prefix is not formally reserved for the Core vocabulary, it is RECOMMENDED that extension keywords (in vocabularies or otherwise) begin with a character other than "$" to avoid possible future collisions.

Please consider

  • creating one or more vocabularies to formally define your keywords
  • removing the $ from them

For an example of a custom vocabulary, please see my data keyword vocabulary spec.

I realize that this will be a breaking change, but these keywords exist in direct conflict with a recommendation of the specification.

@handrews
Copy link

handrews commented Sep 22, 2022

@gregsdennis they do allow disabling these keywords.

Implementing support for $vocabulary, making a vocabulary, and publishing a meta-schema requiring the vocabulary would (like OpenAPI 3.1's extensions) allow the extensions to be interoperable. See json-schema-org/json-schema-spec#1295 for significant clarification of $vocabulary's behavior and use cases - no change from the intent of 2019-09 and 2020-12, but hopefully the implementation guidance is more clear.

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

2 participants