Add JSON schema validation for fields.json
files
#259
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to #77
This PR adds a JSON schema for
fields.json
files. This file is (mostly) auto-generated, and then combined with documentation to add help text to some fields. All fields have some level of type checking, but not all have descriptions.fields.json
file."json.validate.enable": false
to their Workspacesettings.json
(this is the only way to do this. Dynamically providing schemas isn't really supported in VSCode right now).The schema file is very large (
255kb
). This is due to there being a considerable amount of repeated data in each field definition. All of the base params such as label/type/name/etc. must be explicitly included in each definition since JSON schemas do not provide a way to merge two definitions (allOf
/anyOf
weren't working here). This doesn't seem to lead to any performance problems, since although it's long, the schema is very shallow, so the JSON tree is still relatively small (55 top-level items).