sherlock
sherlock copied to clipboard
Define JSON Schemas to put at the top of each JSON file
Checklist
- [x] I'm reporting a feature request
- [x] I've checked for similar feature requests including closed ones
Description
We maintain quite a few huge JSON files in this repository. It's not impossible that human-error does it's thing and we have typos in fields, or property values that don't make sense, or accidentally add redundant properties etc.
I think we should make a JSON Schema that validates the contents of the JSON files, and we can define them at $schema
.
This will:
- Add code completion and validation on IDEs and code editors when contributors modify the file, vastly improving the contribution experience.
- Allow us to strictly define and document all rules / properties that can be set in the JSON files.
- Maybe later we can add a validation step in CI to ensure the schema matches. (Maybe this could be in code as well for when users use a custom JSON file via the
--json
argument.)