Build and validate JSON schema interactively with property definitions and constraints. Part of the DevTools Surf developer suite. Browse more tools in the API / Config collection.
Use Cases
Build input validation schemas for REST or GraphQL API request bodies.
Generate TypeScript types from JSON Schema using tools like json-schema-to-typescript.
Create documentation schemas that serve as both validation logic and human-readable API contracts.
Validate configuration file formats for CLI tools and frameworks.
Tips
Start from a sample JSON object and let the builder infer the schema — then refine constraints (minLength, enum, pattern) manually.
Add 'required' arrays at each object level explicitly — JSON Schema doesn't require properties by default even if they're defined.
Use $ref to avoid duplicating complex object definitions — define a shared Address schema once and reference it from multiple properties.
Fun Facts
JSON Schema has had multiple competing drafts since 2009. The community adopted Draft 2020-12 as the current reference implementation, but many tools still use Draft 7 — compatibility matters when choosing a validator.
OpenAPI 3.0 uses a strict subset of JSON Schema Draft 04 for its schema objects — not full JSON Schema. OpenAPI 3.1 updated to JSON Schema Draft 2020-12, ending a long compatibility gap.
The ajv (Another JSON Validator) npm package has been downloaded over 3 billion times since 2015 — it's embedded in hundreds of popular tools including webpack, ESLint, and Swagger.
FAQ
Which JSON Schema draft does it use?
Draft 2020-12 by default, with Draft 7 and Draft 2019-09 compatibility modes available. The draft affects which keywords are valid (unevaluatedProperties, prefixItems are 2020-12 only).
Can I validate a JSON file against the schema?
Yes — paste a JSON instance and the builder validates it against the schema using ajv, showing all errors with their JSON path and keyword source.
Does it generate TypeScript from the schema?
It generates a json-schema-to-typescript compatible output. Run 'npx json-schema-to-typescript schema.json > types.ts' on the exported file to get TypeScript interfaces.