Crates.io | infers-jsonschema |
lib.rs | infers-jsonschema |
version | 0.1.0 |
source | src |
created_at | 2020-04-15 19:02:32.262486 |
updated_at | 2020-04-15 19:02:32.262486 |
description | A crate for inferring JSON Schema from input data |
homepage | |
repository | https://github.com/Stranger6667/infers-jsonschema |
max_upload_size | |
id | 230577 |
size | 18,355 |
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#"
})
)
}