API Schema Validator

Runs in browser API Testing

Pick a schema from an OpenAPI document (by path, method and status) or paste a JSON Schema, then validate one or many response samples and get a violation report.

Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

How to use API Schema Validator

  1. Paste a JSON Schema or a full OpenAPI/Swagger document.
  2. For OpenAPI, enter the path (e.g. /orders/{id}), method and status code of the response to check.
  3. Paste one response, or one per line for a batch.
  4. Validate and fix the violations listed (or the contract, if the API is right).

API Schema Validator features

  • Validate one or many JSON responses (JSON Lines) against a JSON Schema
  • Or pick the schema from an OpenAPI 3 / Swagger 2 document by path, method and status
  • Local $ref resolution (components, definitions, $defs), allOf/oneOf/anyOf, formats, nullable
  • Violation table with sample number, path, keyword and message
  • Shows the exact schema used, downloadable as JSON

API Schema Validator example

Batch-validate three orders

Input:

OpenAPI: GET /orders/{id} → 200 → Order
Samples:
{ "id": "ord_1001", "status": "paid", "total": 149.5, "items": [ { "sku": "A-1", "qty": 2 } ] }
{ "id": "1002", "status": "refunded", "total": -5, "items": [] }

Output:

FAIL · Samples 2 · Valid 1 · Violations 4
Sample 2  $.id      pattern  String does not match pattern ^ord_.
Sample 2  $.status  enum     Value must be one of: "pending", "paid", "shipped", "cancelled".
Sample 2  $.total   minimum  Value must be ≥ 0.
Sample 2  $.items   minItems Array has fewer than 1 items.

Frequently asked questions about API Schema Validator

How do I validate against an OpenAPI response?

Paste the OpenAPI/Swagger document, then fill in the path, method and status code — the response schema is resolved (including $ref) and used for validation.

Can I validate many samples at once?

Yes. Paste one JSON document, or one per line (JSON Lines) to validate a whole batch; the violation table shows the sample number.

Which JSON Schema drafts are supported?

The common keywords of draft-07, 2019-09 and 2020-12, plus OpenAPI extras such as nullable.

Why does a $ref fail to resolve?

Only local references (#/components/schemas/X, #/definitions/X, #/$defs/X) are supported; external files are not fetched.

Technical notes

The validator shares its engine with the JSON Schema Validator tool and supports the common draft-07/2019-09/2020-12 keywords. Swagger 2.0 response schemas are read from responses[code].schema; OpenAPI 3 from responses[code].content[application/json].schema.