Skip to content
rusthacks.dev
Web

JSON Schema Validator

Validate a JSON document against a JSON Schema and see every violation with its JSON Pointer path: types, required keys, formats, patterns, enums and more.

Free · No sign-up · Your inputs stay in your browser

Input

Validate JSON against a JSON Schema

Output

4 problems

PathProblem
/idLess than minimum 1.
/emailNot a valid email.
/roles/1Must be one of "admin", "editor", "viewer".
/nicknameProperty "nickname" is not allowed.

Implements the validation keywords of draft 2020-12 that real schemas use: type, enum, const, string and number limits, pattern, the common formats, items and prefixItems, required, properties, patternProperties, additionalProperties, allOf, anyOf, oneOf, not, if/then/else and local $ref. Remote references are reported, not fetched.

Runs in this browser. Nothing you paste is sent to a server.

What JSON Schema is for

JSON Schema describes the shape of a JSON document in JSON. OpenAPI 3.1 uses it for request and response bodies, editors use it to autocomplete config files, and services use it to reject bad input before it reaches business logic. The most common bug it catches is additionalProperties: false rejecting a field that a client started sending.

Limits of this validator

Remote $ref URLs are reported rather than fetched, so nothing leaves the page. For production validation use a maintained implementation that passes the official test suite, such as Ajv in JavaScript or opis/json-schema in PHP.

Share

Frequently asked questions

Which JSON Schema draft should I use?
2020-12, the current release, unless a tool you depend on only supports draft-07. OpenAPI 3.1 aligns with 2020-12; OpenAPI 3.0 uses an older subset.
Why does a valid email fail the format check in some validators?
Format validation is optional in the specification and each implementation chooses how strict to be. Treat format as documentation, and add a pattern if a value must be checked.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Go deeper

Suggested reading

Editor's pick
Flat illustration for the post “An Axum Service You Can Run in Production From Zero”, composed around deploy.
WebGuide

An Axum Service You Can Run in Production From Zero

Build a small Axum 0.8 service from an empty crate to something you can deploy: a testable router, one error type, limits and timeouts, tracing, oneshot tests and graceful shutdown on SIGTERM.

17 min read
Flat illustration for the post “Path Traversal in Rust File Servers and Safe Joins”, composed around security.
Security

Path Traversal in Rust File Servers and Safe Joins

A user-supplied filename like ../../etc/passwd escapes your upload directory. Reject components, canonicalize and verify the prefix, and see why Path::join with an absolute path is a trap.

3 min read

Keep planning

Similar tools