Short answer: A mock drifts when it is maintained separately from the API. A contract mock is generated from the spec, so it cannot return a shape the contract does not declare. The first is a copy that goes stale; the second is a rendering of the source.
How drift shows up
The mock returns a field the API removed, misses a new field, or keeps an old type. The client develops against the mock and fails against the real service.
What a contract mock keeps
| Condition | Separate mock | Contract mock |
|---|---|---|
| Removed field | May remain | Not present |
| New field | May be missed | From spec |
| Type change | May be stale | Current |
| Response shape | As maintained | Valid |
Why the source matters
A generated mock is a build output, like generated code, so it is current on every save. A separate mock is a copy that needs a process to stay aligned.
The honest takeaway
For a stable surface, a separate mock is fine. For a moving API, the drift is the cost that generation removes.
This is part of the Powerduck vs Mockoon comparison. Next, read the CLI comparison.
Comments
Join the discussionNo comments yet. Be the first to comment.

