Skip to content
PithLab

↑↓ to move · Enter to open · Esc to close

JSON Schema Validator API

Validate a JSON document against a JSON Schema (draft 2020-12 or draft-07). Returns valid, every error with its JSON Pointer path and schema keyword, and warnings about unsupported keywords.

POST /api/v1/tools/json-schema-validatorMCP json_schema_validatorDeveloper Tools

Validate JSON data against a JSON Schema in your browser. See every error with its path and a plain English message. Supports draft 2020-12, draft-07 and common formats.

Input

Send these as a JSON object. Unknown fields are rejected.

schema
The JSON Schema, as JSON text. (string, required)
data
The JSON document to validate, as JSON text. (string, required)
draft
Schema draft; auto reads $schema and defaults to 2020-12. (string, one of auto, 2020-12, draft-07, default "auto")
curl https://pithlab.com/api/v1/tools/json-schema-validator \n  -H "Authorization: Bearer $PITHLAB_KEY" \n  -H "Content-Type: application/json" \n  -d '{"schema":"{\"type\":\"object\",\"required\":[\"name\",\"age\"],\"properties\":{\"name\":{\"type\":\"string\"},\"age\":{\"type\":\"integer\",\"minimum\":0}}}","data":"{\"name\":\"Ada\",\"age\":-1}"}'
Example response
{
  "ok": true,
  "result": {
    "valid": false,
    "draft": "2020-12",
    "errors": [
      {
        "instancePath": "/age",
        "schemaPath": "#/properties/age/minimum",
        "keyword": "minimum",
        "message": "must be >= 0"
      }
    ],
    "warnings": []
  }
}