Schemas are written in Yaml under src/
and then converted to json.
To edit the schemas and immediately test the changes, do the following:
- Run
pnpm run dev
- Open the schema you want to edit
- Open an example file from
tests/local/
- Edit & save the Yaml schema file
- Trigger the autocomplete for the thing you want to check
Most of the time you'll be able to see issues in vscode. But that's not always the case.
Before making a PR, be sure to run the validate-examples
script
Note: this is NOT perfect. Proper tests will eventually be written to ensure nothing breaks when updates are made to the schemas.
The validator is written in python and I recommend you install Python >= 3.11
.
After python is set up, do the following:
-
Install
pipx
On a mac:
brew install pipx pipx ensurepath # If you want to allow # pipx actions with --global argument: sudo pipx ensurepath --global
Check
pipx
docs for other systems.Enabling autocompletions for zsh:
pipx install argcomplete # run the command below and follow the instructions pipx completions
-
Install
check-jsonschema
pipx install check-jsonschema
-
Validate the schemas
From the repository root, run:
./validate-schemas.sh