infers-jsonschema

Crates.ioinfers-jsonschema
lib.rsinfers-jsonschema
version0.1.0
sourcesrc
created_at2020-04-15 19:02:32.262486
updated_at2020-04-15 19:02:32.262486
descriptionA crate for inferring JSON Schema from input data
homepage
repositoryhttps://github.com/Stranger6667/infers-jsonschema
max_upload_size
id230577
size18,355
Dmitry Dygalo (Stranger6667)

documentation

README

infers-jsonschema

This crate provides JSON Schema inference from input data.

Example:

use infers_jsonschema::infer;
use serde_json::json;

fn main() {
    let data = json!(["foo", "bar"]);
    let schema = infer(&data);
    assert_eq!(
        schema,
        json!({
            "type": "array",
            "items": {"type": "string"},
            "$schema": "http://json-schema.org/draft-07/schema#"
        })
    )
}
Commit count: 10

cargo fmt