rs-data-json-schema 0.1.0
Validate a serde_json Value against a JSON Schema subset and report every error with its JSON pointer
Install
cargo add rs-data-json-schema --registry rupm
In Ruststudio: Packages, search for rs-data-json-schema, Install.
Owner: Rust Studio. Licence: MIT OR Apache-2.0. Total downloads: 0. Published 2026-11-23.
Versions
- 0.1.0 2026-11-23
README
# rs-data-json-schema
Validate a serde_json Value against a JSON Schema subset and report every error with its JSON pointer.
## Install
`rupm add rs-data-json-schema` (or `cargo add rs-data-json-schema --registry rupm`).
## Usage
```rust
let schema = serde_json::json!({"type": "object", "required": ["name"]});
let errors = rs_data_json_schema::validate(&schema, &serde_json::json!({}));
assert_eq!(errors[0].path, "");
```
## API overview
- `validate(schema, instance) -> Vec<ValidationError>`: empty means valid.
- Supports type, properties, required, items, enum, minimum, maximum, minLength, maxLength.
- `ValidationError { path, message }` with a JSON pointer path.