Crates.io | jsonschema_code_generator |
lib.rs | jsonschema_code_generator |
version | 2.0.0 |
source | src |
created_at | 2021-05-06 21:52:36.345243 |
updated_at | 2021-06-29 23:00:19.829091 |
description | Crate for generating rust types from JSON schemas |
homepage | |
repository | https://github.com/tim-hellhake/jsonschema_code_generator |
max_upload_size | |
id | 393999 |
size | 105,137 |
This Rust crate allows you to generate Rust types from JSON Schemas.
It attaches serde_json attributes to the structs for json serialization/deserialization.
use jsonschema_code_generator::generate;
use std::path::Path;
fn main() {
let rust_code = generate(&Path::new("schemas/draft-04.json"));
println!("{}", rust_code);
}
anyOf
and allOf
definitions to a single type