Skip to main content

Crate rskit_schema

Crate rskit_schema 

Source
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§

CompiledSchema
Reusable compiled JSON Schema validator.
Options
Options for customizing schema generation.
SchemaDocument
Owned JSON Schema document that has passed structural limit checks.
ValidationError
A single validation error with a JSON-pointer path.
ValidationLimits
Limits applied before compiling or validating untrusted JSON schema values.
ValidationOptions
Options for schema compilation and value validation.
ValidationResult
Outcome of validating a value against a schema.

Traits§

JsonSchema
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§

JsonSchema
Derive macro for JsonSchema trait.