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

Add JSON schema validation for fields.json files #259

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

j-malt
Copy link
Contributor

@j-malt j-malt commented Jan 24, 2024

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.

  • To test, follow standard VSCode testing procedure and open a fields.json file.
  • To disable this feature, one can add "json.validate.enable": false to their Workspace settings.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).

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 this pull request may close these issues.

1 participant