Crates.io | json-schema-generator |
lib.rs | json-schema-generator |
version | 0.1.1 |
source | src |
created_at | 2024-09-21 17:37:06.123825 |
updated_at | 2024-09-21 17:46:09.061132 |
description | A tool to generate JSON Schema from JSON data |
homepage | |
repository | https://github.com/AtlasPilotPuppyjson-schema-generator |
max_upload_size | |
id | 1382369 |
size | 85,686 |
This is a command-line tool that generates JSON Schema from JSON data. It's built in Rust and provides a simple way to create JSON Schema definitions from existing JSON structures.
To install the JSON Schema Generator, you need to have Rust and Cargo installed on your system. Then, you can clone this repository and build the project:
cargo install json_schema_generator
json_schema_generator test.json
git clone https://github.com/AtlasPilotPuppy/json-schema-generator.git
cd json-schema-generator
cargo build --release
The compiled binary will be available in target/release/json_schema_generator
.
json_schema_generator [OPTIONS] [INPUT_FILE]
-o, --output <FILE>
: Specify the output file. If not provided, output will be written to <INPUT_FILE>.jsonschema
or stdout if reading from stdin.-s, --stdout
: Force output to stdout, even when an input file is provided.-h, --help
: Print help information.Generate schema from a file:
json_schema_generator input.json
Generate schema from a file and save to a specific output file:
json_schema_generator input.json -o output_schema.json
Generate schema from stdin:
cat input.json | json_schema_generator
Generate schema from a file and output to stdout:
json_schema_generator input.json --stdout
This tool generates JSON Schema compatible with draft-07.
Contributions are welcome! Please feel free to submit a Pull Request.