The Compatibility Promise Nobody Writes Down

"We won't break the API" is a promise most teams believe they're keeping, right up until a client crashes on a perfectly reasonable change — adding a new field, adding a new enum value — because the promise was never actually written down precisely enough for anyone to know what it covered.
Two different promises, often confused for one
Backward compatibility is about new server versions still working with old clients: a client built against last year's API should keep working today, even though the server has changed underneath it. This is the promise most people mean by "don't break the API," and it's mostly about not removing or repurposing things — don't delete a field, don't change what a status code means, don't make a previously-optional field required.
Forward compatibility is the less-discussed half: today's clients should tolerate a future server sending them something they don't yet know about, without crashing. This is entirely about how defensively the client itself was written — does it choke on an unrecognized field, an unexpected enum value it's never seen, or an extra item in an array it assumed had a fixed length?
A server can be perfectly backward compatible (it genuinely never removed anything) and still break real clients the moment it adds something new, if those clients weren't written to tolerate the unfamiliar. That's a forward-compatibility failure, and it's squarely the client's responsibility, not the server's — which is exactly why it's the half of this that gets neglected, since it's not the API team's promise to keep.
What a forward-compatible client actually looks like
A few habits that make a client resilient to additive change, which is nearly always the safe kind of API evolution:
- Deserialize permissively. Ignore unrecognized fields rather than rejecting a payload because it contains something the client wasn't told to expect. Most JSON deserialization does this by default; strict schema validation that rejects "additional properties" by default actively works against forward compatibility unless that strictness is a deliberate choice.
- Treat an unrecognized enum value as "unknown," not a crash. A
statusfield that's always been"pending" | "active" | "closed"will eventually get a fourth value. Code with an exhaustive switch and no default case breaks the moment that happens; code with a sensible fallback for "anything else" doesn't. - Don't assume a list's length or a payload's exact shape beyond what you actually need from it.
Testing for both directions on purpose
Backward compatibility testing looks like: run your old test suite (or an older client build, if you have one) against the current API and confirm nothing that used to work now fails. Forward compatibility testing looks like the opposite and less commonly done check: run your current client against a deliberately mutated response — extra fields injected, an unfamiliar enum value substituted in — and confirm it doesn't crash.
The second one is specifically well-suited to a mock, because there's no way to get a real server to send you a field or enum value from the future on demand — you have to fabricate it deliberately. A route's response body, hand-edited to include exactly the kind of surprising-but-plausible addition a future API version might send, run against your actual client code, is the most direct way to find out whether "we'll never break you" is actually true in both directions, or just the direction that was easy to test.
Xerat02
Building MockBase.
More from the blog

The Content-Type Header Your Download Button Ignores (Until It Doesn't)
A browser will render, download, or silently mangle a response differently depending on one header most endpoints get right by accident — and "it worked when I tested it" usually means you tested the one case where the accident didn't matter.

Circuit Breakers: Stopping One Slow Dependency From Taking Down Everything
A dependency that hangs instead of failing fast can tie up every worker waiting on it until the calling service runs out of capacity too. A circuit breaker exists to cut that off before it spreads.