| Crates.io | jsonschema-cli |
| lib.rs | jsonschema-cli |
| version | 0.40.0 |
| created_at | 2024-09-14 16:43:33.374412+00 |
| updated_at | 2026-01-18 00:10:52.839826+00 |
| description | A command line tool for JSON Schema validation. |
| homepage | |
| repository | https://github.com/Stranger6667/jsonschema |
| max_upload_size | |
| id | 1374923 |
| size | 124,451 |
A fast command-line tool for JSON Schema validation, powered by the jsonschema crate.
Download the latest binary for your platform from the releases page:
Linux (x86_64):
jsonschema-cli-x86_64-unknown-linux-gnu.tar.gz - Standard GNU libcjsonschema-cli-x86_64-unknown-linux-musl.tar.gz - Static binary (MUSL), no dependenciesLinux (ARM64):
jsonschema-cli-aarch64-unknown-linux-gnu.tar.gz - Standard GNU libcjsonschema-cli-aarch64-unknown-linux-musl.tar.gz - Static binary (MUSL), no dependenciesmacOS:
jsonschema-cli-x86_64-apple-darwin.tar.gz - Inteljsonschema-cli-aarch64-apple-darwin.tar.gz - Apple SiliconWindows:
jsonschema-cli-x86_64-pc-windows-msvc.zip - MSVC runtimejsonschema-cli-x86_64-pc-windows-gnu.zip - MinGW, no Visual Studio requiredNote: MUSL variants are statically linked and work across all Linux distributions, including Alpine.
Example installation on Linux/macOS:
# Download and extract (replace VERSION with actual version, e.g., cli-v0.36.0)
curl -LO https://github.com/Stranger6667/jsonschema-rs/releases/download/VERSION/jsonschema-cli-x86_64-unknown-linux-gnu.tar.gz
tar xzf jsonschema-cli-x86_64-unknown-linux-gnu.tar.gz
# Move to a directory in your PATH
sudo mv jsonschema-cli /usr/local/bin/
cargo install jsonschema-cli
jsonschema [OPTIONS] <SCHEMA>
NOTE: It only supports valid JSON as input.
-i, --instance <FILE>: JSON instance(s) to validate (can be used multiple times)--output <text|flag|list|hierarchical>: Select output style (default: text). text prints the human-friendly summary, while the structured modes emit newline-delimited JSON (ndjson) records with schema, instance, and JSON Schema Output v1 payloads.-v, --version: Show version information--help: Display help informationValidate a single instance:
jsonschema schema.json -i instance.json
Validate multiple instances:
jsonschema schema.json -i instance1.json -i instance2.json
Emit JSON Schema Output v1 (list) for multiple instances:
jsonschema schema.json -i instance1.json -i instance2.json --output list
{"output":"list","schema":"schema.json","instance":"instance1.json","payload":{"valid":true,...}}
{"output":"list","schema":"schema.json","instance":"instance2.json","payload":{"valid":false,...}}
jsonschema Rust crateFor each instance:
text (default): prints <filename> - VALID or <filename> - INVALID. Errors: followed by numbered error messages.flag|list|hierarchical: emit newline-delimited JSON objects shaped as:{
"output": "list",
"schema": "schema.json",
"instance": "instance.json",
"payload": { "... JSON Schema Output v1 data ..." }
}
This project is licensed under the MIT License.