Validate JSON Against a Schema
Use JSON Schema ideas to check required fields, types, and nested shapes after your document is syntactically valid.
Syntax validity is not structural correctness
A document can parse as JSON and still be useless to your application. Missing required keys, strings where numbers belong, or arrays of the wrong shape will fail later—often after the payload has crossed service boundaries.
JSON Schema describes constraints on that shape. Even a small subset—type, required, properties, items, enum, min/max—catches a large class of integration bugs.
A minimal workflow
Repair malformed input first. Schema validators assume they are looking at a value tree, not a broken string. Once fixjson.dev reports valid JSON, open Schema Validator, paste a schema, and run Validate Schema.
Start schemas from your TypeScript types or OpenAPI models. Keep early schemas narrow: require the fields your endpoint actually reads, then tighten enums and ranges as examples accumulate.
What the built-in checker covers
The on-site validator supports a practical subset: type, required, properties, items, minLength/maxLength, minimum/maximum, and enum. It is meant for quick checks in the workshop, not as a replacement for a full draft-2020-12 implementation in CI.
For production pipelines, run the same schemas with a dedicated library (Ajv, jsonschema, etc.) in tests and at service edges. Use the browser tool to iterate on examples before you commit those schemas.
Common mistakes
Validating before repair wastes time on punctuation failures. Over-specified schemas reject legitimate clients. Under-specified schemas give false confidence. Prefer schema checks on trusted boundaries: after LLM repair, before database writes, and in contract tests between services.