Expand description
Back‑compatibility checking library.
This crate depends on json_schema_ast, which provides a strict
in‑memory representation (SchemaNode) of a Draft 2020‑12 JSON Schema. The
only responsibility of this crate is to offer algorithms that compare two
schemas and decide whether a change is backward‑compatible from the point
of view of a serializer or deserializer.
Structs§
- Schema
Node - Shared, interior-mutable representation of a JSON Schema node. Using
reference counting allows multiple parents to point to the same node which
is required to faithfully model schemas containing recursive
$refs.
Enums§
- Role
- The role under which a compatibility check is performed.
- Schema
Node Kind - An internal Abstract Syntax Tree (AST) representing a fully-resolved JSON Schema draft-2020-12 document. The node types are deliberately very close to the JSON Schema specification so that higher-level crates (e.g. the back-compat checker or fuzz generator) can reason about schemas without constantly reparsing raw JSON values.
Functions§
- build_
and_ resolve_ schema - Build and fully resolve a schema node from raw JSON + a base URL.
- build_
schema_ ast - Build the high-level AST without immediately resolving references.
- check_
compat - Top‑level convenience wrapper:
- is_
subschema_ of - Returns
trueif every instance that satisfiessubalso satisfiessup. - resolve_
refs - Recursively resolves
SchemaNode::Refby looking up fragments inroot_json. - type_
constraints_ subsumed - Compare the constraints of two nodes of the same basic type.