# json_schema_ast
JSON Schema AST and reference resolver.
[](https://crates.io/crates/json_schema_ast) [](https://docs.rs/json_schema_ast) [](../LICENSE)
## Installation
Add to your `Cargo.toml`:
```toml
[dependencies]
json_schema_ast = "0.2.1"
```
## Usage
```rust
use json_schema_ast::{build_and_resolve_schema, compile, SchemaNode, JSONSchema};
use serde_json::json;
let raw = json!({
"type": "object",
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" }
},
"required": ["id"]
});
// Build AST
let schema_node: SchemaNode = build_and_resolve_schema(&raw).unwrap();
// Compile a fast validator
let validator: JSONSchema = compile(&raw).unwrap();
// Validate instances
assert!(validator.is_valid(&json!({ "id": 42 })));
```
## License
Licensed under MIT. See [LICENSE](../LICENSE).