The backend changed an API response: catch it before the crash
The price field was a number and became a string. The app crashes on the listing screen, and the backend changelog doesn’t say a word about it. Microkoi Bench builds the contract of every endpoint from recorded traffic and shows which field changed, when, and which server sent the new response.
Why a response breaks without warning
A backend developer changed how the price is serialized so the web gets it with spaces. To them it’s a detail, and the backend tests are green. The mobile real estate app parses price as a number and crashes for everyone who opens a listing.
Changes like this are found through user reviews or by chance, while eyeballing a response. To find them earlier, you need a memory of how the endpoint has always answered.
{
"id": 48213,
"title": "2-bedroom, 54 m²",
"price": 12400000,
"agent": { "name": "Sales team", "rating": 4.8 }
}{
"id": 48213,
"title": "2-bedroom, 54 m²",
"price": "12 400 000",
"agent": null
}The contract builds itself
There’s nothing to describe. Bench takes the first three server responses with the same path template, method and status code and infers a contract from them: which fields arrive, what type they are and whether they’re required. GET /v1/{id} · 200 and the same path with 404 are different contracts.
The model of any response is in the “Model” view on the Body tab: a Field · Type · Example table, nested objects expand with an arrow, and ? marks an optional field. The badge above the table says whether the response matches the contract.
Only server responses go into the contract. Mock responses, chaos and exchanges paused at a breakpoint aren’t counted: they say nothing about what the server does. Values of the same type aren’t a change — 100 and 100.5 are both numbers.
Where you see that a response changed
| Where | What you see |
|---|---|
| Traffic table row | A braces icon on the response with a mismatch |
| Endpoint tree | Yellow braces and the number of changes on the method |
| Above the table | The “Contract changed” bar when you select the endpoint |
| Response “Model” | The field row: number → string, since when and from which server |
The “Contract changed” bar starts with what matters: how many changes and whether all servers answer the new way. For example, “3 changes · all from 10.0.0.7, 10.0.0.4 answers as before” — the new backend build is on one server out of two. Each field shows its path, before and after, the number of the last exchange before the change and the first one after it.
- Type change: price — “number → string”.
- The field became null: agent.
- The field is gone though it was in every response:
agent.rating— number → missing. - A new field after the contract settled: absent → string.
The compare icon on a field opens the last response before the change next to the first one after it. The before-and-after proof takes one click.
An agreed change — accept it
Not every change is a bug. If the new field was discussed in advance, click “Accept change” on the field or “Accept all changes” for the whole event. The new model becomes the contract, the icons go out and the numbers in the tree go down. There’s no confirmation dialog, and “Undo” brings back the previous model.
Check what you recorded earlier
New responses are checked right away. To find exactly when the server started answering differently, check the history: in the “⋯” menu of a host or method in the tree, choose “Check contracts in history”. The check runs in the background, recording doesn’t wait for it, and the result above the table says how many endpoints have mismatches.
Send the backend an HTML report
“Export to HTML” on an event saves the mismatch as a single file: the endpoint and status code, when and from which server the responses changed, every field with its types before and after, fragments of both responses and a per-server summary. The file opens in any browser without Bench and without a network.
The “Types only” option leaves values and body fragments out of the file: only field names and types remain. You can attach that report to a ticket without worrying about what ended up in the examples.
The contract works in other sections too
In Traffic, the line of a field that differs from the contract is highlighted yellow in the “Format” view of any JSON response. A response in Requests and a check response in Monitoring are compared with the same contract: a mismatched field is highlighted. A monitor also remembers the model of its own response and turns yellow when it changes, so a format change is noticed even when you haven’t opened the app.
What you get
A change in the response format is visible on the day it happens, not after app store reviews. The backend gets a report with the field, the time and the server, and the conversation is about facts.
Use your app with beta 0.9.6 for a week and write to beta@microkoi.com about the contract changes Bench found and the ones it missed. We read every email.