sherlock icon indicating copy to clipboard operation
sherlock copied to clipboard

Define JSON Schemas to put at the top of each JSON file

Open SethFalco opened this issue 2 years ago • 0 comments

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:

  1. Add code completion and validation on IDEs and code editors when contributors modify the file, vastly improving the contribution experience.
  2. Allow us to strictly define and document all rules / properties that can be set in the JSON files.
  3. 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.)

SethFalco avatar May 07 '22 07:05 SethFalco