JSON Schema Validation/Validate with Ajv CLI

Validate a JSON file against a schema file.

Section: Schema validation workflows

Validate with Ajv CLI

bash
bash
npx ajv-cli validate -s schema.json -d data.json
Explanation

A convenient Node-based workflow for JSON Schema validation.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Schema validation workflows
Validate multiple files with Ajv
Validate a whole set of JSON documents.
OpenIn sheetbashsame section
Basic object schema
Require a string name and boolean active flag.
OpenIn sheetjson2 tag match
Enum restriction
Restrict a value to a known set of strings.
OpenIn sheetjson2 tag match
Array item validation
Validate every item in an array.
OpenIn sheetjson2 tag match