Expand description
Schema definitions for fuzzy repair
This module provides schema types that callers use to define valid field names, type discriminators, and expected value shapes for fuzzy matching and coercion.
§Design
Schemas are built from three layers:
FieldKind— the expected shape of a single field value (enum set, nested object, coercion target, …). Nested kinds make the schema recursive: objects inside arrays inside objects can all be described and repaired.ObjectSchema— a set of named fields (FieldDef) for one object.TaggedEnumSchema— a discriminated union: a tag field selects whichObjectSchemaapplies.
All schema types own their strings, so schemas can be built at runtime
(e.g. from a config file or an API definition), not only from 'static
literals.
Structs§
- Field
Def - A named field with an expected value shape.
- Object
Schema - Schema for an object with known fields.
- Tagged
Enum Schema - Schema for a tagged enum (discriminated union)
Enums§
- Field
Kind - Expected shape of a single field value.