All the parameters you store in Vect can be automatically validated using our robust and expressive validation engine, which supports both JSON Schema and JTD specifications. Validations can be configured on a glob-pattern basis, with multiple validations covering parts or the entirety of your Vect repository.
<aside> đź’ˇ Once configured, validations run for each change you make to your parameters. For open changes, failing validations will block the change deployment until resolved or the change is manually confirmed.
</aside>
Depending on the specification you want to use, create the validation under .vect/resources/json-schema-validation for JSON Schema, or under .vect/resources/jtd-validation for JTD.
A validation file might look like the following example:
restaurants-schemarestaurants-schemaThis schema maps to objects with the structure demonstrated below
gourmetta-restuarantTransformations define which parameters files will be affected by your schema validators. In order to run, each new validation you create must have a corresponding transformation that goes with it. Create the transformations under .vect/transformation using the following format:
{
"type": <json-schema-validation or jtd-validation>,
"schemaFileName": <path-to-validation-file>
"sourceFileGlobPattern": <paths-to-validate-glob-patterns>
}
Validation outputs are accessed from the Validations section in the Review page. The Validations section summarizes the various validations that run for the change. Each validation can have one of two statuses: Done for a successful run and Failed for an unsuccessful run. Note that these statuses refer only to the validation’s execution status, and not to whether the parameters files are valid or not.
Clicking on each validation will show it’s outputs, each output represents a file on which the validation ran. An out put status can be either valid - if the validation passed for the file, or invalid - if the validation failed. Clicking on an output will reveal additional information regarding the validation status of the file.