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 — JSON Pointer path errors.

12.08.2026
10 min read
Share this article:
json-schema
validation
API
openapi
Tutorial

Why validate JSON data against a schema?

Valid JSON is not the same as valid for your API. A payload can parse perfectly yet miss a required field, ship the wrong type, or violate a format constraint — and 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 dual Monaco editors (schema + instance), entirely in your browser. Pair it with the JSON validator when syntax is suspect first, and with validate-openapi when the contract lives in OpenAPI. Explore the API tools hub for schema conversion and OpenAPI linting siblings.

Schema vs syntax: catch missing required fields and type mismatches after JSON parses
Draft-07 and 2020-12 via Ajv — instancePath / keyword errors per violation
Dual editors with live debounce (~300 ms) — no install, 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 fetch — external and https:// $ref never resolve
No multi-file bundle — paste self-contained schema JSON per run
No OpenAPI path-operation lint — use lint-openapi for operationId and tags
No live endpoint probing — instance must be pasted explicitly
Draft-04/06/2019-09 schemas are rejected — migrate or convert drafts first
Schema design tips

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

Always set $schema in shared files — 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 — document deprecated values in description
Version breaking schema changes — 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 — trailing commas, single quotes, truncated paste
JSON Schema Validator (json-schema-validator): semantic contract — types, required, enums, formats
Syntax green + schema red = contract violation, not a parse error
Repair broken JSON first with json-repair or the validator's sibling links
OpenAPI document validation is a third intent — 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-12https://json-schema.org/draft/2020-12/schema
Draft-07http://json-schema.org/draft-07/schema#
Draft-04, Draft-06, and 2019-09 return a clear unsupported-draft error — not silently coerced
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 — 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 list separately — fix top-down or by 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 (left) and Instance (right). Paste JSON into each field — YAML is not accepted in the schema editor (JSON only). Max 512 KiB per field.

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

Strict mode turns on Ajv strict: true at schema compile time — 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 <code>components.schemas</code>
Strict compile errors surface in the results panel — fix schema, then re-test instance
Pair Strict with <a href="/en/format-openapi" class="text-primary hover:underline">format-openapi</a> when schemas are embedded in large specs
Not a substitute for org-wide Spectral or custom vocabulary governance
Scenario — 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

Step 1: Confirm JSON syntax

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

2

Step 2: Paste schema and instance

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

3

Step 3: Read instancePath errors

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

Scenario — Config file before Kubernetes apply

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

1

Step 1: Load schema from repo

Copy the schema JSON (self-contained — external $ref are not resolved in-browser).

2

Step 2: Validate your edit

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

3

Step 3: Chain with YAML tools if needed

Configs often start as YAML — convert with yaml-to-json, validate 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. Workflow: validate-openapi (spec envelope) → extract schema → json-schema-validator (payload vs schema). 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, pivot formats on the hub without a local CLI: openapi-to-json-schema extracts a schema from OpenAPI components; json-schema-to-openapi wraps a standalone schema into an OpenAPI shell for portal import.

Contract testing mindset

Browser validation accelerates feedback; CI still owns regression suites. Paste representative instances — happy path, edge nulls, 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.

Missing required property — instancePath points at parent or /
Wrong type — string where integer expected (common after form serialization)
additionalProperties: false — extra fields from API versioning mistakes
format violations — date-time, email, uuid (via ajv-formats)
enum mismatch — undocumented status codes or region codes in payloads
Frequent schema compile errors

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

Unsupported $schema URL — upgrade to Draft-07 or 2020-12
External $ref — hard error; inline or bundle refs locally first
YAML pasted into schema editor — convert to JSON or use JSON-only paste
Schema exceeds 512 KiB — split schemas or use CI bundlers
Unknown keywords under Strict — remove or move to description / vendor extensions per policy

Conclusion

JSON Schema validation closes the gap between parseable JSON 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 — 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: