Pact introduces consumer-driven contracts: your client defines expectations, and the provider verifies against them.
Key advantage:
- Prevents unintentional breakage
- Promotes API stability across teams
Example pact snippet:
{ "provider": { "name": "UserService" }, "consumer": { "name": "Dashboard" }, "interactions": [...] }
We integrated Pact with CI to reject builds that broke published contracts. It raised trust across services.