concept

Consumer Contract

A machine-readable record of exactly which parts of a provider's response one consumer relies on, generated from that consumer's own tests.

The insight is that a provider's obligation is not its full published schema; it is the union of what its consumers actually use. A consumer contract captures the smaller thing: this consumer sends these requests and depends on these specific fields having these types and these semantics.

Generating it from the consumer's own tests is what keeps it honest. A hand-written contract states what the consumer's authors believe they depend on; a generated one states what the code actually did when exercised.

The practical consequence is freedom in both directions. The provider can change anything no consumer relies on — remove a field nobody reads, add fields freely, reorder — without ceremony, because the contracts prove nobody notices. And it cannot silently break the fields that are relied upon. Without contracts, providers face the opposite situation: every published field is potentially load-bearing, so nothing can ever be removed, and schemas accrete forever.