#json-schema #json-schema-validation #validation

app jsonschema-cli

A command line tool for JSON Schema validation

26 releases (11 breaking)

0.30.0 Apr 16, 2025
0.29.1 Mar 27, 2025
0.29.0 Feb 8, 2025
0.28.1 Dec 31, 2024
0.26.1 Oct 29, 2024

#940 in Web programming

Download history 38/week @ 2025-01-08 13/week @ 2025-01-15 270/week @ 2025-01-22 49/week @ 2025-01-29 163/week @ 2025-02-05 69/week @ 2025-02-12 67/week @ 2025-02-19 43/week @ 2025-02-26 30/week @ 2025-03-05 17/week @ 2025-03-12 8/week @ 2025-03-19 182/week @ 2025-03-26 45/week @ 2025-04-02 37/week @ 2025-04-09 200/week @ 2025-04-16 25/week @ 2025-04-23

322 downloads per month

MIT license

1MB
20K 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–16MB
~212K SLoC