Validate JSON against a JSON Schema (repairs broken input first)
validate_jsonCheck JSON against a JSON Schema and get every error with its JSON Pointer path. Send the JSON either as text ("input"; broken text is repaired first, and the fixes are listed) or as an already-parsed value ("data"). Optional coerce converts "42" → 42, "true" → true, etc. toward the schema's types before validating and lists each change. A schema mismatch is a normal result (valid: false), not an error. Drafts 2020-12 (default), 2019-09, 7, 4; only local $refs. Pure computation: read-only, no network access, inputs not stored. Same engine and limits as POST /api/v1/validate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | An already-parsed JSON value to validate. Send this or "input", not both. | |
| draft | No | JSON Schema draft. Default: from the schema's $schema, else 2020-12. | |
| input | No | JSON text to validate (repaired first if broken). Send this or "data", not both. Max 102,400 bytes. | |
| coerce | No | Convert values toward the schema's declared types before validating: "42" → 42, "true" → true, "null" → null, 5 → "5", x → [x]. Each change is listed in coercions. | |
| schema | Yes | A JSON Schema (draft 2020-12 by default; 2019-09, 7 and 4 also supported). Only local $refs (#/...) resolve; remote $refs are an error. Max 32 KB. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| json | Yes | The validated value (after repair and coercion) | |
| plan | No | ||
| draft | No | ||
| fixes | No | ||
| valid | Yes | ||
| errors | Yes | ||
| coerced | No | ||
| version | No | ||
| repaired | No | true when "input" needed repair before validation | |
| warnings | No | ||
| coercions | No | ||
| errorCount | Yes | Total errors (at most 50 are listed); a lower bound when errorsTruncated is true | |
| errorsTruncated | Yes | true when the validator produced more than 5,000 raw errors and only the first 5,000 were examined |