Skip to main content

check_compat

Function check_compat 

Source
pub fn check_compat(
    old: &SchemaDocument,
    new: &SchemaDocument,
    role: Role,
) -> Result<bool, CompatibilityError>
Expand description

Return whether new is backward-compatible with old under role.

The checker is a structural subset proof over the documents’ resolved schema graphs:

  • Role::Serializer checks new ⊆ old: every value produced under the new schema must still be accepted by clients using the old schema.
  • Role::Deserializer checks old ⊆ new: every previously accepted value must still be accepted by the new schema.
  • Role::Both requires both directions.

A return value of Ok(false) is a proven or conservative incompatibility. A return value of Err(_) means the checker cannot soundly run on the input schema or feature set.