Skip to main content

Crate jsoncompat

Crate jsoncompat 

Source
Expand description

Backward-compatibility checks for evolving JSON Schema documents and OpenAPI 3.1 contracts.

Build input documents with SchemaDocument::from_json, then call check_compat with a Role. This crate intentionally exposes only the document-level JSON Schema compatibility API; lower-level resolved IR types live in json_schema_ast. OpenAPI validation and lowering live in the sibling jsoncompat_openapi crate; this crate layers compatibility reports over those lowered request and response schemas.

Structs§

OpenApiCompatibilityIssue
OpenApiCompatibilityReport
OpenApiDocument
SchemaDocument
Fully resolved JSON Schema document.
SchemaHistory
SchemaVersionEntry
StampBundle
StampManifest
StampResult

Enums§

CompatibilityError
Compatibility-check failures that are distinct from a proven incompatibility.
CompatibilityWarning
Compatibility diagnostics that do not prevent a modeled comparison.
OpenApiCompatibilityError
OpenApiCompatibilitySurface
OpenApiError
OpenApiLoweringError
Role
The role under which a compatibility check is performed.
StampError
StampStatus

Constants§

ENVELOPE_DATA_KEY
ENVELOPE_VERSION_KEY
STAMP_MANIFEST_VERSION

Functions§

canonical_schema_hash
check_compat
Return whether new is backward-compatible with old under role.
check_openapi_compat
compatibility_warnings
Return non-fatal compatibility diagnostics for one schema document.
explain_compat_failure
Return a best-effort static explanation for the first incompatibility under role, or Ok(None) when the checker finds no incompatibility to explain.
stamp_schema
validate_compatibility_input
Return whether this schema can participate in compatibility checks.
validate_openapi_compatibility_input
Return whether an OpenAPI document is fully supported by the compatibility layer.
write_stamp_manifest_atomic

Type Aliases§

SchemaBuildError
Public schema-build error name used by SchemaDocument::from_json.