JSON Schema: Validate Data Online (Draft 2020-12)

JSON Schema: Validate Data Online (Draft 2020-12)

Test API payloads and config files against JSON Schema Draft 2020-12 — errors pinpointed by JSON Pointer path, in the browser.

12.08.2026
7 min read
Share this article:
json-schemavalidationAPIopenapiTutorial

Validating JSON data against a schema

Valid JSON is not the same as valid for your API. A payload can parse perfectly. It can still miss a required field, ship the wrong type, or violate a format constraint. Those bugs often surface only in integration tests or production logs. JSON Schema answers a different question than syntax checking: does this instance conform to the contract? FastMinify's online JSON Schema validator runs Draft-07 and 2020-12 validation in two Monaco editors (schema and instance), entirely in your browser. If the syntax is in doubt, start with the JSON validator. If the contract lives in OpenAPI, use validate-openapi. The API tools hub lists the schema conversion and OpenAPI linting tools.

Schema vs syntax: catch missing required fields and type mismatches after JSON parses
Draft-07 and 2020-12 through Ajv, with instancePath and keyword errors per violation
Two editors with live validation after a short debounce (~300 ms), no install and no account
Optional Strict mode for schema review (Ajv strict: true at compile time)
100% local: schema and payloads never leave the browser

Honest limits and maintainable schemas

What the browser validator does not do

A green result means the instance matched the pasted schema, not that your entire API platform is compliant.

No network requests, so external $ref values, including https:// ones, never resolve
No multi-file bundle: paste one self-contained schema JSON per run
No lint of OpenAPI path operations: use lint-openapi for operationId and tags
No live endpoint probing, so the instance must be pasted explicitly
Draft-04, Draft-06, and 2019-09 schemas are rejected, so migrate or convert the drafts first
Schema design tips

Schemas that validate cleanly in the browser tend to survive CI and SDK generation.

Always set $schema in shared files, to avoid implicit 2020-12 assumptions
Prefer additionalProperties: false only when you enforce closed objects deliberately
Use examples in OpenAPI and paste them as validator instances in reviews
Keep enums aligned with code, and document deprecated values in description
Version breaking schema changes, so consumers validate against the schema tag they target
When to escalate to CI tooling

Browser checks save pipeline minutes; org policy still lives in CI.

Ajv or jsonschema in GitHub Actions / GitLab CI on every PR
Breaking-change detectors between schema versions
Pact or contract tests against live environments
Schema registries (Apicurio, Buf) for multi-team governance
Combine with CI/CD automation for full pipeline hygiene

JSON syntax vs JSON Schema validation

Two validators, two questions

Do not swap tools mid-debug; each answers a distinct failure mode.

JSON Validator (json-validator): syntax only, such as trailing commas, single quotes, or a truncated paste
JSON Schema Validator (json-schema-validator): the semantic contract, meaning types, required fields, enums, and formats
A green syntax check with a red schema check means a contract violation, not a parse error
Repair broken JSON first with json-repair or the validator's sibling links
Validating an OpenAPI document is a third intent, so use validate-openapi for the spec envelope
Supported drafts (and what is rejected)

FastMinify detects the draft from $schema when present; missing $schema defaults to 2020-12.

Draft 2020-12: https://json-schema.org/draft/2020-12/schema
Draft-07: http://json-schema.org/draft-07/schema#
Draft-04, Draft-06, and 2019-09 return a clear unsupported-draft error and are never coerced silently
Declare the draft explicitly in shared schemas to avoid team drift
OpenAPI 3.1 aligns with 2020-12; OpenAPI 3.0 commonly uses Draft-07 in components.schemas
instancePath and keyword errors

When validation fails, Ajv reports where the instance broke the schema, which is essential for large API payloads.

instancePath points to the failing value (JSON Pointer style)
Keyword name shows which rule failed (required, type, format, …)
Multiple violations are listed separately, so fix them top-down or by the highest-impact field
Empty instance with required schema → path / or missing property paths
Use json-tree-viewer alongside deep payloads for navigation

Validate JSON against a schema, step by step

Using the JSON Schema validator

The JSON Schema validator provides two editors: Schema on the left and Instance on the right. Paste JSON into each field. YAML is not accepted in the schema editor, which takes JSON only. The limit is 512 KiB per field.

Live validation after a short debounce (~300 ms) once both sides parse
Results panel: valid or invalid, violation count, detected draft
For each error: instancePath, keyword, and message
Copy and expand (⌘⇧E) actions on each editor pane
The Strict toggle is off by default; enable it for CI-style schema linting
When to enable Strict mode

Strict mode turns on Ajv strict: true at schema compile time, so unknown keywords and other non-strict schema patterns fail before instance validation.

Off (default): pragmatic debugging of real-world schemas with extra keys
On: schema review before publishing to a registry or OpenAPI components.schemas
Strict compile errors surface in the results panel, so fix the schema, then re-test the instance
Pair Strict with format-openapi when schemas are embedded in large specs
Not a substitute for org-wide Spectral or custom vocabulary governance
An API response fails in staging

Your mobile client crashes on a new field shape. The response is valid JSON but breaks the published schema.

1

Confirm the JSON syntax

Paste the response into json-validator. If syntax fails, repair before schema validation.

2

Paste the schema and the instance

Open json-schema-validator. Paste the canonical schema (from an OpenAPI export or a schema registry) and the staging response.

3

Read the instancePath errors

Fix the API or update the schema with a deprecation plan. Re-validate after deploy. Optionally diff staging against production payloads.

A config file before a Kubernetes apply

A team shares a JSON config validated in CI with JSON Schema, and you need a quick local check without cloning the pipeline.

1

Load the schema from the repo

Copy the schema JSON. It must be self-contained, because external $ref are not resolved in the browser.

2

Validate your edit

Paste the edited config as the instance. Enable Strict if the schema is authored for strict review.

3

Chain with the YAML tools if needed

Configs often start as YAML. Convert with yaml-to-json, validate the syntax, then schema-validate the JSON instance.

OpenAPI, components.schemas, and conversion

Where schemas live in API contracts

REST teams often publish shapes in OpenAPI components.schemas, while JSON Schema registries store standalone files. The validator accepts either once extracted as JSON. The workflow starts with validate-openapi for the spec envelope, extracts the schema, then checks the payload against it with json-schema-validator. See our OpenAPI validation guide and lint & format guide for the spec side of the contract.

Convert between OpenAPI and JSON Schema

When the schema source is the OpenAPI file, you can pivot formats on the hub without a local CLI. Use openapi-to-json-schema to extract a schema from OpenAPI components. Use json-schema-to-openapi to wrap a standalone schema into an OpenAPI shell for portal import.

Contract testing mindset

Browser validation speeds up feedback, while CI still owns regression suites. Paste representative instances: the happy path, edge nulls, and enum boundaries. Document the draft in $schema next to every shared schema file in git.

Common validation failures

Frequent instance errors

These show up constantly in support tickets and flaky CI jobs.

A missing required property: instancePath points at the parent or /
Wrong type, such as a string where an integer is expected (common after form serialization)
additionalProperties: false catches extra fields from API versioning mistakes
format violations such as date-time, email, or uuid (through ajv-formats)
enum mismatch from undocumented status codes or region codes in payloads
Frequent schema compile errors

Strict mode and unsupported drafts surface here before instance validation runs.

An unsupported $schema URL: upgrade to Draft-07 or 2020-12
An external $ref is a hard error, so inline or bundle refs locally first
YAML pasted into the schema editor: convert it to JSON or paste JSON only
A schema above 512 KiB: split it or use CI bundlers
Unknown keywords under Strict: remove them or move them to description or vendor extensions, depending on policy

Conclusion

JSON Schema validation closes the gap between JSON that parses and trustworthy API data. Start with syntax when needed, then validate instances against Draft-07 or 2020-12 schemas with clear instancePath errors, locally before CI. Extract schemas from OpenAPI when contracts live in specs, and keep browser checks honest about refs, drafts, and size limits.

Syntax first with json-validator, schema validation second
Declare $schema explicitly in every shared schema file
Enable Strict when reviewing schemas before merge, not when debugging loose payloads
Bundle external $ref locally, because the browser tool never fetches URLs
Chain with openapi-to-json-schema when the schema source is an OpenAPI file
Share this article
Share this article: