#json-schema #infer #java #typescript #python #dart #auto-magically

bin+lib schemajen

SchemaJen - Auto-magically infer language bindings given a JSON schema

2 unstable releases

0.2.0 Apr 13, 2023
0.1.0 Apr 12, 2023

#5 in #infer

21 downloads per month

AGPL-3.0

40KB
1K SLoC

SchemaJen

Auto-magically infer language bindings given a JSON schema.

Bridging client and backend is hard. This is especially true if your backend is written in a different language from your client. Schemajen is a tool that makes the process almost painless. Given a JSON request, response, or literally anything, SchemaJen can infer working language bindings.

Language Support

  • Rust
  • Typescript
  • Dart
  • Python 3.8+
  • Java (via java.io.Serializable)

Feel free to send in language requests or additional implementations!

Try it now!

You can try the web version of SchemaJen here.

Alternatively, you can also install the CLI version of SchemaJen using cargo.

cargo install schemajen

Contributing / Using the Crate

Being built in Rust, SchemaJen comes as a crate. You can find more on the docs and crate information pages.

Example Usage

use schemajen::*;

//  See [`ACCUMULATOR_SUPPORT_LIST`] for string options.
//  let mut accumulator = accumulator_choose_with_str("rust");

let mut accumulator = Box::new(RustAccumulator::begin());
let res = generate(&mut accumulator, "MyType", r#"{"a": 10}"#);
res.unwrap();
eprintln!("{}", res);

Dependencies

~140–375KB