Expand description
Generic JSON repair logic
This module provides generic fuzzy repair functions that work with any schema provided by the caller.
§Architecture
Repair walks the JSON value tree guided by the schema:
- Field-name repair — object keys are fuzzy-matched against the
schema’s field names and renamed (collision-safe, first-win; skipped
renames are recorded as
SkippedCorrections). - Value repair — each field’s value is repaired according to its
FieldKind: fuzzy correction against closed sets, recursive descent into nested objects / arrays of objects, or scalar type coercion.
Every change is recorded as a Correction; every rename that was
not applied because the target key already existed is recorded as a
SkippedCorrection. Nothing is changed silently.
Structs§
- Correction
- A single correction made during repair
- Fuzzy
Options - Options for fuzzy repair
- Repair
Log - Accumulated log of a repair pass: applied and skipped corrections.
- Repair
Result - Result of a repair operation
- Skipped
Correction - A correction that was found but not applied.
Enums§
- Skip
Reason - Why a candidate correction was not applied.
Functions§
- repair_
enum_ array - Repair values in an enum array
- repair_
fields_ with_ list - Repair field names in a JSON object using a field list
- repair_
object_ fields - Repair a JSON object using an
ObjectSchema - repair_
tagged_ enum - Repair a tagged enum JSON object using a TaggedEnumSchema
- repair_
tagged_ enum_ array - Repair an array of tagged enums
- repair_
tagged_ enum_ json - Repair a tagged enum from JSON string