An open API service indexing awesome lists of open source software.

https://github.com/stranger6667/infers-jsonschema

A crate to detect JSON schema from sample data
https://github.com/stranger6667/infers-jsonschema

Last synced: about 1 year ago
JSON representation

A crate to detect JSON schema from sample data

Awesome Lists containing this project

README

          

# infers-jsonschema

This crate provides JSON Schema inference from input data.

Example:

```rust
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#"
})
)
}
```