Developer

How to Validate JSON Against a Schema Locally and Privately

Validate JSON against Draft 7, 2019-09 or 2020-12 in your browser. Follow a webhook example, interpret error paths, and understand local reference limits.

By ToolMint Editorial Team

4 min read Published Sep 29, 2026 Updated Oct 18, 2026

Key facts

Last updated
Oct 18, 2026

Validate an API payload without uploading it

To check whether a JSON payload satisfies a data contract, paste the payload and its schema into ToolMint's JSON Schema Validator, choose the matching draft, and select Validate. Parsing and validation run in your browser; ToolMint does not upload the JSON or schema for this check.

JSON Schema describes constraints such as required properties, value types and allowed ranges. A document can be valid JSON syntax and still violate those constraints. This walkthrough is for developers checking a webhook payload before using the same contract in an application.

Choose the draft your contract uses

ToolMint supports Draft 7, Draft 2019-09 and Draft 2020-12. It does not support Draft 4, Draft 6 or custom dialects in this version.

Draft What to check before validating
Draft 7 Keep this selection when maintaining an existing Draft 7 contract. Reusable definitions commonly live under definitions.
Draft 2019-09 Supports $defs and newer rules such as dependentRequired and unevaluatedProperties.
Draft 2020-12 Uses prefixItems for tuple positions and changes how items applies after them.

The Ajv draft documentation explains these differences. Changing only the $schema URI does not migrate a contract: its keywords must also match the intended draft.

In Auto mode, ToolMint reads a recognized root $schema declaration. Without that declaration, it uses Draft 2020-12 and shows a notice. If you choose a different supported draft manually, the tool shows a mismatch warning. Prefer a matching declaration and selection so the result reflects the contract you intend to enforce.

Work through a failing webhook payload

Step 1: Paste the schema

Open the validator and paste this schema into the editor labelled JSON Schema. It requires an invoice.paid event and a delivery attempt that is an integer of at least 1. The local $ref reuses a definition inside the same document.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "event": { "const": "invoice.paid" },
    "delivery": { "$ref": "#/$defs/delivery" }
  },
  "required": ["event", "delivery"],
  "additionalProperties": false,
  "$defs": {
    "delivery": {
      "type": "object",
      "properties": {
        "attempt": { "type": "integer", "minimum": 1 }
      },
      "required": ["attempt"],
      "additionalProperties": false
    }
  }
}

Step 2: Validate the candidate data

Paste this fictional payload into JSON Data, leave the draft on Auto, and select Validate:

{
  "event": "invoice.paid",
  "delivery": { "attempt": "1" }
}

The payload parses as JSON but fails validation. Its attempt value is a string because it has quotation marks. The schema requires an integer; the validator does not automatically convert the value.

Step 3: Read the error and repair the payload

For this example, the error identifies:

Error field Result Meaning
Instance path /delivery/attempt The value in the payload that failed the rule
Schema path #/$defs/delivery/properties/attempt/type The rule inside the pasted schema
Keyword type The constraint that failed
Message must be integer The expected value type

Change the data to the following and select Validate again:

{
  "event": "invoice.paid",
  "delivery": { "attempt": 1 }
}

This payload passes. Setting attempt to 0 fails the minimum rule; removing it fails required. Those are different problems from the original type error. Correct the data according to the real contract rather than weakening the schema just to get a passing result.

Understand paths, references and common failures

An instance path uses JSON Pointer syntax, which identifies a value rather than a source-code line. A property name containing / uses ~1 in the pointer, and ~ uses ~0. A schema path identifies the failed rule. Schema validation errors should not be read as exact line-number highlights.

For selecting values after validation, use the JSONPath Tester. The expression $.delivery.attempt selects the example's attempt value; it does not enforce the integer or minimum constraints.

ToolMint accepts same-document references such as #/$defs/delivery. It rejects external $ref documents, including web URLs and relative file paths, without fetching them. Keep referenced definitions in one self-contained schema. The JSON Schema reference guide explains how references and schema identifiers work.

If validation cannot start, first check both inputs for JSON syntax errors. Then check the declared draft, selected draft and references. The JSON Formatter can help inspect syntax and indentation. Formatting alone does not establish that a payload satisfies its schema.

Privacy and practical limits

ToolMint performs schema validation with Ajv in the current browser tab. JSON input, schema text and validation errors are not uploaded or included in analytics. With analytics permitted, aggregate interaction details such as the chosen draft and outcome may be recorded. Use fictional or redacted payloads when sharing examples with colleagues.

The tool accepts up to 2 MB of JSON data and 512 KB of schema text, with additional depth and node limits. Complex schemas and regular expressions can still consume browser resources. A passing result establishes only that this input meets these schema constraints. It does not authenticate a webhook sender, authorize an action or enforce every application business rule. Validate again in the application that receives the data.

For broader payload checks, see JSON tips for developers.

Sources

Sources checked and the walkthrough reviewed on October 18, 2026.

Enjoyed this guide? Share it.

Related tools

Browse all →

Related guides