ITEngineeringTools

JSON Schema Validator

Validate JSON against a browser-local Draft 2020-12 subset with local references and JSON Pointer errors.

Input

Result

How it works

The supported subset covers type, const, enum, required, properties, additionalProperties, numeric and length bounds, pattern, items, prefixItems, allOf, anyOf, oneOf, not and local JSON Pointer references through $defs. Unsupported keywords are reported explicitly. Validation runs in a time-limited worker and performs no network requests.

Formula

Evaluate applicable constraints at each instance path. All ordinary constraints must pass, and composition follows the selected allOf, anyOf, oneOf or not rule.

Practical examples

Valid service port

JSON instance: {"port":443}
JSON schema: {"type":"object","required":["port"],"properties":{"port":{"type":"integer","minimum":1,"maximum":65535}}}

Valid instance

Invalid invoice value

JSON instance: {"amount":-5}
JSON schema: {"properties":{"amount":{"type":"number","minimum":0}}}

/amount: number outside allowed bounds

Reuse a local definition

JSON instance: ["alpha","beta"]
JSON schema: {"$defs":{"item":{"type":"string"}},"type":"array","items":{"$ref":"#/$defs/item"}}

Valid instance

Technical references