server/contract/contract_check library

Compares two route manifests and reports what changed.

This is drift detection, not client generation. routes.json describes a route surface — methods, paths, parameter names, locations and requiredness, and the top-level name of what each handler returns. It carries no field lists, no nested types and no serialisation strategy, so it cannot produce a typed client and does not try to. What it can do is tell a consumer that the producer moved underneath it, which is the part that actually breaks deployments.

A consumer pins the manifest it built against; CI compares the producer's current manifest to that pin.

Classes

ContractChange
One difference between a pinned manifest and a current one.
ContractReport
The result of comparing a pinned manifest against a current one.

Enums

ContractSeverity
How much a single difference matters to a consumer.

Functions

checkContract(Map<String, dynamic> pinned, Map<String, dynamic> current) ContractReport
Compares pinned against current, both decoded routes.json payloads.