contract drift
When the data a server actually sends slowly stops matching what its clients expect, usually without anyone noticing until something breaks.
In more detail
Drift happens when a field is renamed, removed or changes type on one side only. Sharing schemas, generating clients from one specification and validating outgoing responses in tests all catch drift before it reaches users.
Example
In this course: Drift goes unnoticed while each side's own tests stay green. Verifying the provider against consumer contracts on every build catches it before deployment.Related terms
- API contract — The written promise an API makes about its operations, inputs, outputs and errors, which callers rely on while the code behind it changes.
- validation schema — A description of what valid data looks like, checked by code while the program runs so bad data is rejected at the door.
- OpenAPI — A standard, language-neutral format for describing an HTTP API: its paths, operations, parameters, request and response schemas, errors and security.
- contract testing — Testing that an API’s real behaviour matches its written contract, and that its callers only rely on what the contract promises.
- generated client — Client code produced automatically from an API specification such as an OpenAPI document.
- fake — A test double that is a small but working implementation of a dependency, such as an in-memory database standing in for a real one.
Taught in
- Monorepo Architecture: Workspaces & Turborepo — Production Full-Stack Engineering
- End-to-End Type Safety: Shared Schemas & DTOs — Production Full-Stack Engineering
- API Contract Architecture: OpenAPI 3.1 & Schema Truth — Production Full-Stack Engineering
- Type-Safe Client Generation: Orval & Automated SDKs — Production Full-Stack Engineering
- Working With Jackson — Modern Java: Virtual Threads & High-Throughput Services
- Implementing An OpenAPI Contract — Modern Java: Virtual Threads & High-Throughput Services
- Testing APIs With MockMvc — Modern Java: Virtual Threads & High-Throughput Services
- Contract Testing Between Services — Automated Testing, TDD & Quality Engineering