25 releases (10 breaking)

0.29.1 Mar 27, 2025
0.28.3 Jan 24, 2025
0.28.1 Dec 31, 2024
0.26.1 Oct 29, 2024

#999 in Web programming

Download history 174/week @ 2024-12-15 292/week @ 2024-12-22 242/week @ 2024-12-29 46/week @ 2025-01-05 19/week @ 2025-01-12 232/week @ 2025-01-19 75/week @ 2025-01-26 117/week @ 2025-02-02 101/week @ 2025-02-09 79/week @ 2025-02-16 43/week @ 2025-02-23 44/week @ 2025-03-02 14/week @ 2025-03-09 11/week @ 2025-03-16 147/week @ 2025-03-23 63/week @ 2025-03-30

236 downloads per month

MIT license

675KB
15K SLoC

jsonschema-cli

crates.io docs.rs

A fast command-line tool for JSON Schema validation, powered by the jsonschema crate.

Installation

cargo install jsonschema-cli

Usage

jsonschema [OPTIONS] <SCHEMA>

NOTE: It only supports valid JSON as input.

Options:

  • -i, --instance <FILE>: JSON instance(s) to validate (can be used multiple times)
  • -v, --version: Show version information
  • --help: Display help information

Examples:

Validate a single instance:

jsonschema schema.json -i instance.json

Validate multiple instances:

jsonschema schema.json -i instance1.json -i instance2.json

Features

  • Validate one or more JSON instances against a single schema
  • Clear, concise output with detailed error reporting
  • Fast validation using the jsonschema Rust crate

Output

For each instance, the tool will output:

  • <filename> - VALID if the instance is valid
  • <filename> - INVALID followed by a list of errors if invalid

Example output:

instance1.json - VALID
instance2.json - INVALID. Errors:
1. "name" is a required property
2. "age" must be a number

Exit Codes

  • 0: All instances are valid (or no instances provided)
  • 1: One or more instances are invalid, or there was an error

License

This project is licensed under the MIT License.

Dependencies

~9–17MB
~215K SLoC