Stage 3 · Build
Testing & Release Confidence
Contract Testing
Validate API compatibility with OpenAPI schemas, Pact contracts, generated clients, and backward-compatible fixtures.
Why Contract Testing
APIs are consumed by clients. If you change the API shape, clients break. Contract tests verify that the API matches its specification. They catch breaking changes before deployment.
OpenAPI Validation
Pact Contracts
Generated Clients
Backward-Compatible Fixtures
Breaking Change Detection
# Compare current proto against main branch
buf breaking --against ".git#branch=main"
# Compare OpenAPI specs
oapi-diff old-spec.yaml new-spec.yamlAutomated breaking change detection catches incompatible changes in CI. buf checks proto files. oapi-diff checks OpenAPI specs. Both prevent accidental breaking changes.
Contract testing separates consumer expectations from provider implementation. Consumers define what they need. Providers verify they deliver it. This decouples deployment cycles.
Mark this lesson complete to store local progress and unlock a cleaner resume path the next time you visit.