Skip to main content

Module json_schema

Module json_schema 

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

AllOfSchema
AllOf schema (all schemas must match)
AnyOfSchema
AnyOf schema (at least one schema must match)
ArraySchema
Array type schema
BooleanSchema
Boolean type schema
ConstSchema
Const schema (single fixed value)
EnumSchema
Enum schema (fixed set of allowed values)
GenericSchema
Generic schema (catch-all) This handles schemas without explicit type, including:
IntegerSchema
Integer type schema
NotSchema
Not schema (must not match the schema)
NullSchema
Null type schema
NumberSchema
Number type schema (floating point)
ObjectSchema
Object type schema (with explicit type: “object”)
OneOfSchema
OneOf schema (exactly one schema must match)
ReferenceSchema
Reference schema ($ref)
SchemaMetadata
Common metadata fields for all schema types
StringSchema
String type schema

Enums§

AdditionalProperties
Additional properties policy
JsonSchema
JSON Schema root type
TypedSchema
Typed schema (discriminated by “type” field)