-
Notifications
You must be signed in to change notification settings - Fork 63
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
Reserve top-level $schema
property?
#107
Comments
While we're on the topic of JSON Schema, I started working on a public schema that aligns with much of the current draft. My current version is a little more opinionated in group structure than the spec, but I'm sure the token definitions are still useful. I'm happy to contribute to an official spec schema if there's interest! |
Definitely agree with this. The token format is currently missing some kind of versioning field anyway, and |
I agree this could be useful and could double as a versioning field (something we've been meaning to add anyway). We could have the spec version that the file conforms to as part of the URL to the corresponding schema. E.g.: {
"$schema": "https://designtokens.org/spec/v1.2.3/schema.json",
// ^ This file follows version 1.2.3 of the DTCG spec
// tokens and groups go here as per usual
} I also agree that having a JSON schema for our spec could be useful. It would allow some basic validation of files and can enable some auto-completion features in some IDEs. It's something that's been suggested before and has been discussed at previous editors meetings too. We've just not gotten around to properly exploring the topic yet. When we do, I'm sure @natemoo-re's schema will be a valuable input, so thanks for sharing that! Also, since we've now decided to use |
Visual Studio Code supports a top-level
$schema
property which provides their JSON Language Server with automatic completions, hovers, etc. While it is not part of the JSON Schema specification, it is a feature that I see being used with increasing frequency. See schemastore.org for examples of tools which have public schemas.IMO calling this property out in the specification would be wise, even just as something that tools should accept but ignore. I've definitely encountered tools that have trouble validating or parsing a JSON file when
$schema
is used and it can be a pain.The text was updated successfully, but these errors were encountered: