config-file-validator icon indicating copy to clipboard operation
config-file-validator copied to clipboard

Add support for schema validation

Open kehoecj opened this issue 2 years ago • 0 comments

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

kehoecj avatar Sep 30 '23 00:09 kehoecj