One schema, three formats
YAML, TOML, and JSON all parse into the same data model. So JSON Schema validates all three with no changes. You write the schema once; you point validators at any of the three formats; the rules apply uniformly.
Validators that work across formats
check-jsonschema— Python tool,pip install check-jsonschema, validates JSON, YAML, TOML against a JSON Schema.ajv-cliwith YAML loader — fastest validator for JSON; YAML support via--data-stream+js-yaml.spectral— for OpenAPI specifically; runs JSON Schema rules on YAML or JSON specs.- Editor schema integration — VS Code's YAML / JSON / TOML extensions all read schemas from Schema Store and provide autocomplete + inline validation, regardless of format.
Schema-first as a discipline
Pick the format your team prefers, but write the schema in JSON Schema. The schema becomes the single source of truth. Convert as needed. Your schema is also documentation, autocomplete, type generator, mock data generator — depending on how far you want to go.
Principle: validate at boundaries, trust internally. The boundary is where untyped data enters your system — config load, API request, file upload. Validate there with JSON Schema; downstream code can assume the shape is correct.