config-file-validator
config-file-validator copied to clipboard
Add support for schema validation
Description
Initial feedback provided by the development community showed that they expected that this tool would have schema validation in addition to providing syntax validation. A couple projects in other languages do this but usually just support at most XML, JSON, and YAML
Some project provided in the feedback
https://github.com/pyeve/cerberus https://cuelang.org/ https://pypi.org/project/specker
Looks like there are several existing go libraries that we could leverage to perform schema validation:
| Configuration Type | Schema Validation Libraries |
|---|---|
| XML | xsd |
| JSON | gojsonschema |
| YAML | Use gojsonschema (support and instructions) |
| HCL | hcl-lang |
| CSV | csvchecker |
We'll want to keep the option to keep current syntax only functionality available - probably though --syntax-only flag