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.
Enums§
- Role
- The role under which a compatibility check is performed.
- Schema
Node - 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. TODO: need roundtrip tests
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
true
if every instance that satisfiessub
also satisfiessup
. - resolve_
refs - Recursively resolves
SchemaNode::Ref
by looking up fragments inroot_json
. - type_
constraints_ subsumed - Compare the constraints of two nodes of the same basic type.