jsonschema_code_generator

Crates.iojsonschema_code_generator
lib.rsjsonschema_code_generator
version2.0.0
sourcesrc
created_at2021-05-06 21:52:36.345243
updated_at2021-06-29 23:00:19.829091
descriptionCrate for generating rust types from JSON schemas
homepage
repositoryhttps://github.com/tim-hellhake/jsonschema_code_generator
max_upload_size
id393999
size105,137
Tim Hellhake (tim-hellhake)

documentation

https://docs.rs/jsonschema_code_generator

README

jsonschema_code_generator

Build Status Latest Version Docs

This Rust crate allows you to generate Rust types from JSON Schemas.

It attaches serde_json attributes to the structs for json serialization/deserialization.

Example

use jsonschema_code_generator::generate;
use std::path::Path;

fn main() {
    let rust_code = generate(&Path::new("schemas/draft-04.json"));
    println!("{}", rust_code);
}

Todo

  • Add support for draft 4 schemas
  • Resolve definitions across files
  • Resolve struct name collisions
  • Add macro
  • Merge anyOf and allOf definitions to a single type
  • Add support for draft 7 schemas
  • Add support for draft 2019-09 schemas
  • Add support for draft 2020-12 schemas
Commit count: 20

cargo fmt