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
- Host: GitHub
- URL: https://github.com/stranger6667/infers-jsonschema
- Owner: Stranger6667
- License: mit
- Created: 2020-02-27T22:21:10.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-01T10:30:40.000Z (almost 6 years ago)
- Last Synced: 2024-10-19T10:44:50.482Z (over 1 year ago)
- Language: Rust
- Homepage:
- Size: 708 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
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#"
})
)
}
```