Updated Oct 15, 2026

Utilities

Validate JSON data against a schema with Ajv

ajv-validate is a strict JSON Schema draft-7 validation node powered by Ajv CLI.

Agent

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.

source github.com/ajv-validator/ajv-cli

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

1 inputs
NameTypeFlagDescription
sourceFOLDER--sourceFolder 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 · command
ajv validate --spec=draft7 --strict=true --all-errors --errors=json -s schema.json -d data.json
sample output
{
  "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

Two UTF-8 files named schema.json and data.json. Symbolic links are refused.

Draft-7 in strict mode. Other drafts are outside this wrapper contract.

No. It produces a report with valid: false and native errors. Malformed schemas or input failures fail the task.

No. References must remain within the schema document. Custom plugins, coercion and defaults are disabled.

The schema limit is 256 KiB, data limit 1 MiB, schema depth 64, schema nodes 10000 and native subprocess limit 30 seconds.

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.