pajv is a command-line JSON Schema validator that supports multiple data formats including CSON, Hjson, JSON5, TOML, and YAML, in addition to standard JSON. Version 1.2.0 is the latest stable release, built on top of Ajv (Another JSON Schema Validator) and any-json for format parsing. It provides a unified CLI interface for validating data files against JSON Schema, with features like referenced schemas, custom keywords, and error formatting. pajv is a fork of ajv-cli and extends its functionality to support polyglottal input formats. The project is actively maintained with regular updates.
npm install pajvNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Installs pajv globally and validates a YAML file against a JSON Schema, showing success vs failure.
Use child_process.spawn or exec to run pajv commands, or use the 'ajv' package directly for programmatic validation.
Ensure data files have recognized extensions (.json, .yaml, .yml, .toml, .cson, .hjson, .json5) or use any-json directly.
Use quotes: pajv -s schema.json -d "test/*.json"
Add --spec draft-04 or --spec draft-06 if needed. Note: pajv uses Ajv's default settings.
Example: pajv -s schema.json -d data.json -c ./my-keywords.js or -c ajv-keywords
Run `npm install -g pajv` and ensure npm global bin directory is in your PATH.
Run `npm install -g pajv` again to ensure dependencies are installed.
Ensure data matches schema type constraints. Example schema: { "type": "string" }Check file paths and use absolute or correct relative paths. Use -s ./schema.json if needed.