Validate JSON/YAML data against JSON Schema definitions. Part of the DevTools Surf developer suite. Browse more tools in the Data / SQL collection.
Use Cases
Validate application configuration files (database config, feature flags) against a schema before deployment.
Validate incoming API request bodies against a schema at the edge to reject malformed payloads early.
Test data pipeline outputs conform to the expected schema before downstream processing.
Generate TypeScript types from JSON Schema as part of a code generation pipeline.
Tips
Use $schema and $id at the top of every JSON Schema document — these help validators determine the dialect and support relative $ref resolution.
Leverage additionalProperties: false to catch typos in config files — unknown properties silently ignored are a common source of configuration bugs.
Use allOf, anyOf, and oneOf deliberately: allOf requires all subschemas to pass; oneOf requires exactly one — mixing them up causes validation passes or failures that are hard to debug.
Fun Facts
JSON Schema was first proposed in 2009 by Kris Zyp as an Internet-Draft. It went through 7 major draft versions before the 2020-12 release, which is the current stable specification.
OpenAPI 3.0 (2017) uses a subset of JSON Schema for its schema definitions, making JSON Schema a foundational standard for API specification across the industry.
YAML, despite having its own type system, is commonly validated using JSON Schema after conversion to JSON — reflecting how dominant JSON Schema has become as a validation language.
FAQ
Which JSON Schema draft should I use?
Use draft 2020-12 for new projects — it has the most complete tooling support as of 2024. Draft 7 is still widely supported and is the minimum baseline for most validators.
Can JSON Schema validate YAML files?
Yes — convert YAML to JSON first (trivial with most parsers), then validate against the schema. The schema itself is expressed in JSON or YAML interchangeably.