Page 1 of 1

Validating JSON file with YAML schema

Posted: Fri Aug 23, 2024 1:00 pm
by vogesu
How can I validate a JSON file with a schema encoded in YAML ?If I select "validate with..." myschema.yaml" for my .json example the validator says the schema does not start with "{" which is clear....

Re: Validating JSON file with YAML schema

Posted: Fri Aug 23, 2024 4:51 pm
by florin_nica
Hello,

Oxygen JSON Editor does not support YAML Schema validation directly. However, you can convert your YAML Schema file to a JSON Schema file using the YAML to JSON converter in the JSON Tools menu. After conversion, you can use the resulting JSON Schema file for the "Validate with..." action. Since YAML Schema is a minor extension of JSON Schema Draft 4, the validation results should be accurate.

Regards,
Florin