Skip to content

Forbid custom keywords that start with $ #1321

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

Closed
gregsdennis opened this issue Sep 28, 2022 · 2 comments · Fixed by #1388
Closed

Forbid custom keywords that start with $ #1321

gregsdennis opened this issue Sep 28, 2022 · 2 comments · Fixed by #1388

Comments

@gregsdennis
Copy link
Member

gregsdennis commented Sep 28, 2022

The Core keywords are easily identifiable by the fact that they start with $.

The specification recommends against defining custom keywords which also start with $, but this recommendation seems to be repeatedly ignored by implementations ($data seems to be a common violator).

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.

Since this recommendation has been in the spec for multiple iterations, maybe it's time to move this to a MUST NOT requirement.

@handrews
Copy link
Contributor

handrews commented Oct 6, 2022

We avoided doing that because plenty of implementations support weird custom $-prefixed keywords. However, if we remove support for non-vocabulary keywords, I can see forbidding other vocabulary keywords from using it. Those older cases were non-vocabulary extensions.

@gregsdennis
Copy link
Member Author

We've decided that unknown (non-vocab) keywords will be unsupported moving forward (pending some additional options).

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 a pull request may close this issue.

2 participants