Collection of JSON schemas used by uCentral for validating the data model. Rendering of configuration JSON into device-specific output is performed by separate flavour-specific renderer repos.
In order to generate and validate schema artifacts you will need the following tools:
- python3
- PyYAML (
pip3 install pyyaml) - ucode
- jq
- json-schema-for-humans (
pip3 install json-schema-for-humans)
Run the repo generator from the repository root:
./tools/generate.shThis regenerates:
ucentral.schema.jsonucentral.schema.pretty.jsonucentral.schema.full.jsonucentral.state.pretty.jsonvalidator/ucode/schemareader.ucvalidator/bash/schemareader.sh
The repository is organized as follows:
schema/- schema source definitionsstate/- state schema source definitionstools/merge-schema.py- merges schema YAML into generated JSON artifactstools/generate.sh- regenerates schema and validator artifactsgenerators/ucode/generate-reader.uc- generatesvalidator/ucode/schemareader.ucgenerators/bash/generate-bash-reader.uc- generatesvalidator/bash/schemareader.shvalidator/ucode/schemareader.uc- autogenerated ucode validator returning the prepared JSON objectvalidator/bash/schemareader.sh- autogenerated bash validator returning the prepared JSON object
- JSDoc: https://ucentral.io/docs/
schemaobject: http://ucentral.io/docs/ucentral-schema.htmlstateobject: https://ucentral.io/docs/ucentral-state.html