| Crates.io | jsonschema-for-toml |
| lib.rs | jsonschema-for-toml |
| version | 0.1.0 |
| created_at | 2025-04-14 13:57:03.502098+00 |
| updated_at | 2025-04-14 13:57:03.502098+00 |
| description | A command-line tool for validating TOML files against JSON Schema. |
| homepage | |
| repository | https://github.com/foolishell/jsonschema-for-toml |
| max_upload_size | |
| id | 1632856 |
| size | 59,710 |
A command-line tool for validating TOML files against JSON Schema.
This tool is inspired by jsonschema-cli and provides similar functionality, but specifically for TOML files.
cargo install jsonschema-for-toml
jsonschema-for-toml <SCHEMA> -i <INSTANCE> [-i <INSTANCE>...]
<SCHEMA>: Path to the JSON Schema file-i, --instance: Path to the TOML file(s) to validate (can be specified multiple times)Validate a single TOML file:
jsonschema-for-toml schema.json -i config.toml
Validate multiple TOML files:
jsonschema-for-toml schema.json -i config1.toml -i config2.toml
For each TOML file, the tool will output:
<filename> - VALID if the file is valid<filename> - INVALID. Errors: followed by a list of errors if invalidExample output:
config1.toml - VALID
config2.toml - INVALID. Errors:
1. "age" must be an integer
2. "email" must be a valid email address
0: All TOML files are valid1: One or more TOML files are invalid, or there was an errorcargo build
cargo test
cargo test -- --nocapture
This project is licensed under the MIT License - see the LICENSE file for details.