Free tool
JSON Schema Validator
Paste a schema on the left and the data on the right. Ajv checks the data as you type and lists every error with the path to the field. Nothing is uploaded.
How it checks
The schema is compiled with Ajv's JSON Schema 2020-12 validator, with ajv-formats for email, uri, date-time, uuid and the other standard formats. It reports all errors, not just the first, and runs in non-strict mode so unknown keywords such as OpenAPI's x- extensions are ignored.
Each error shows where it is (instancePath, for example /user/email) and what failed (must match format "email").
What it catches
- Wrong types
- A string where the schema wants a number, an object where it wants an array.
- Missing required fields
- Anything listed in
requiredthat is not there. - Out-of-range values
minimum,maximum,minLength,maxLength.- Patterns and formats
patternregexes, and formats likeemail,urianddate-time.- Enums
- Values outside the allowed list.
- Extra properties
- Keys the schema does not list, when
additionalPropertiesisfalse.
Schemas from an OpenAPI file
The schemas under components.schemas in an OpenAPI file are JSON Schema. OpenAPI 3.1 uses JSON Schema 2020-12 directly. OpenAPI 3.0 uses an older dialect, so a few keywords differ: nullable: true is not part of 2020-12, and exclusiveMaximum is a boolean there.
Copy one schema out of the spec, convert it to JSON if it is YAML, and paste it here. If it contains $ref to other schemas, paste those in too or inline them, since the validator cannot follow refs into your spec.
Those schemas belong in your docs
Specway reads the schemas in your OpenAPI file and shows them on the page for each endpoint that uses them. Free for one API: create an account.
- A page per endpoint
- Parameters, request body and responses read from the spec, grouped by tag in the sidebar.
- Playground
- Fill in the parameters and send a real request from the docs page.
- Code samples
- cURL, Node, Python, Ruby and PHP for every endpoint, with a copy button and Open in Postman.
Questions
How do I validate JSON against a schema?+
Paste the JSON Schema on the left and the data on the right. The result updates as you type: either valid, or a list of errors with the path to each field. It runs in your browser.
What's JSON Schema vs OpenAPI schema?+
JSON Schema is the standard for describing the shape of JSON. OpenAPI uses it for request and response bodies. OpenAPI 3.1 uses JSON Schema 2020-12 as is. OpenAPI 3.0 uses an earlier dialect with a few differences, such as nullable.
Which JSON Schema drafts are supported?+
The validator uses Ajv's 2020-12 build. Most draft-07 schemas validate the same way. A schema whose $schema names draft-04 or draft-06 will fail to compile; remove the $schema line or update the schema.
How do I validate a request body against my OpenAPI spec?+
Copy the body's schema from components.schemas, paste it as the schema, and paste the request body as the data. To check parameters and headers as well, use request-validation middleware in your server, such as express-openapi-validator.
What does "strict mode" mean?+
Ajv's strict mode rejects schemas with unknown keywords or ambiguous types. This tool runs with strict mode off so schemas from OpenAPI files, which often carry x- extensions, compile. In your own code, strict mode is worth turning on.
Why does my data fail validation but my API accepts it?+
The API may validate less than its schema says, coerce types (a numeric string to a number, for example), or the published schema may be out of date. Any of those means the schema and the API disagree, and one of them should change.
See your docs in a minute
Paste the link to your OpenAPI file. Free for one API, no card needed.