Expand description
JSON Schema representation as Rust ADT
This module provides a strongly-typed representation of JSON Schema (Draft-07) using Rust’s algebraic data types. Each variant contains only the fields relevant to that schema type, avoiding the “bag of optional fields” anti-pattern.
Structs§
- AllOf
Schema - AllOf schema (all schemas must match)
- AnyOf
Schema - AnyOf schema (at least one schema must match)
- Array
Schema - Array type schema
- Boolean
Schema - Boolean type schema
- Const
Schema - Const schema (single fixed value)
- Enum
Schema - Enum schema (fixed set of allowed values)
- Generic
Schema - Generic schema (catch-all) This handles schemas without explicit type, including:
- Integer
Schema - Integer type schema
- NotSchema
- Not schema (must not match the schema)
- Null
Schema - Null type schema
- Number
Schema - Number type schema (floating point)
- Object
Schema - Object type schema (with explicit type: “object”)
- OneOf
Schema - OneOf schema (exactly one schema must match)
- Reference
Schema - Reference schema ($ref)
- Schema
Metadata - Common metadata fields for all schema types
- String
Schema - String type schema
Enums§
- Additional
Properties - Additional properties policy
- Json
Schema - JSON Schema root type
- Typed
Schema - Typed schema (discriminated by “type” field)