Expand description
JSON Schema generation and validation from Rust types.
Thin wrapper around schemars providing a consistent API for generating JSON Schema documents from any type implementing JsonSchema,
plus a runtime validator for checking JSON values against schemas.
Structs§
- Compiled
Schema - Reusable compiled JSON Schema validator.
- Options
- Options for customizing schema generation.
- Schema
Document - Owned JSON Schema document that has passed structural limit checks.
- Validation
Error - A single validation error with a JSON-pointer path.
- Validation
Limits - Limits applied before compiling or validating untrusted JSON schema values.
- Validation
Options - Options for schema compilation and value validation.
- Validation
Result - Outcome of validating a value against a schema.
Traits§
- Json
Schema - A type which can be described as a JSON Schema document.
Functions§
- compile
- Compile a JSON Schema once for repeated validation.
- compile_
with_ options - Compile a JSON Schema once with explicit validation options.
- generate
- Generate a JSON Schema from a type implementing
JsonSchema. - generate_
document - Generate a typed JSON Schema document from a type implementing
JsonSchema. - generate_
with - Generate a JSON Schema with custom options.
- generate_
with_ options - Generate a typed JSON Schema document with custom options.
- validate
- Validate a JSON value against a JSON Schema.
- validate_
structured_ output - Validate structured model output against a JSON Schema 2020-12-compatible schema subset.
- validate_
with_ options - Validate a JSON value against a JSON Schema and return hard setup errors.
Type Aliases§
- Json
- Standard JSON Schema type alias.
Derive Macros§
- Json
Schema - Derive macro for
JsonSchematrait.