Utilities
Validate JSON data against a schema with Ajv
ajv-validate is a strict JSON Schema draft-7 validation node powered by Ajv CLI.
overview
What ajv-validate does
Supply a folder containing schema.json and data.json. The Ajv CLI 5.0.0 node validates the data against a strict draft-7 schema and writes a JSON report containing validity, native errors and input hashes.
The wrapper enables all-errors mode and disables data coercion, defaults and custom plugins. Schema references must stay within the schema document. Remote references and external schema files are outside this contract.
An invalid document produces successful task output with valid set to false and the native validation errors. Malformed JSON, an invalid schema or a native validation failure fails the task. Inspect valid instead of treating a successful task as a passed data check.
Supply regular UTF-8 files. The schema limit is 256 KiB and the data limit is 1 MiB. Schemas are limited to depth 64 and 10000 nodes. The native validation subprocess has a 30-second limit, and the wrapper refuses symbolic links for the supplied folder and files.
The saved synthetic Trickest report identifies a missing required label, an unexpected property and a count with the wrong type. The example demonstrates diagnostic preservation, not compatibility with every JSON Schema draft.
use cases
Where ajv-validate fits
Check structured output
Compare a JSON document with a known draft-7 schema and inspect each error.
Validate configuration data
Report missing fields and incorrect types before passing data downstream.
Keep validation evidence
Retain the report and input hashes alongside the original schema and document.
reference
ajv-validate inputs and flags
| Name | Type | Flag | Description |
|---|---|---|---|
| source | FOLDER | --source | Folder containing schema.json (up to 256 KiB) and data.json (up to 1 MiB). Strict draft-7, in-document references only, schema depth 64 and 10000 nodes, 30 seconds. |
Showing key inputs. ajv-validate exposes 1 inputs in total.
example
Run ajv-validate
ajv validate --spec=draft7 --strict=true --all-errors --errors=json -s schema.json -d data.json{
"tool": "ajv-validate",
"valid": false,
"draft": "draft7",
"errors": [
{
"instancePath": "",
"schemaPath": "#/required",
"keyword": "required",
"params": {
"missingProperty": "label"
},
"message": "must have required property 'label'"
},
{
"instancePath": "",
"schemaPath": "#/additionalProperties",
"keyword": "additionalProperties",
"params": {
"additionalProperty": "extra"
},
"message": "must NOT have additional properties"
},
{
"instancePath": "/count",
"schemaPath": "#/properties/count/type",
"keyword": "type",
"params": {
"type": "integer"
},
"message": "must be integer"
}
]
}guidance
Choosing ajv-validate
Use this node for strict draft-7 validation of one JSON document. Choose another operation when you need later drafts, remote references, custom keywords or data transformation.
jq
Selects and transforms JSON. It does not provide the same schema-validation contract.
Ajv CLI
The upstream CLI exposes additional configuration; this node offers a fixed strict draft-7 operation.
faq
ajv-validate questions
related
More Utilities tools
browser-fetch
Headless Chromium render: requested URL, final URL, status, and title next to the page.
cewl
Spider a URL and return a wordlist for password crackers.
csvkit
SQL on one CSV. The table name is the file stem.
dnsgen
Wordlist and mined-word subdomain permutation.
duckdb
In-process SQL on CSV, JSON, and Parquet. No server.
edge-tts
Microsoft Edge neural speech from text or a script file. No API key.
Run ajv-validate yourself
Selected fields from the JSON report downloaded from a completed private synthetic Trickest run. Input hashes and duplicate native console text are omitted.
Facts on this page come from the live Trickest tool library.