Two API responses can put the same fields in a different order. Paste the raw responses into a text diff and a moved key can look like a change. If you're debugging a response, the first step is to give both documents the same formatting and key order.
Take these two responses.
Before
{
"status": "queued",
"job": { "retries": 2, "id": 42 },
"steps": ["validate", "run"]
}
After
{
"job": { "id": 42, "retries": 2 },
"steps": ["validate", "run"],
"status": "ready"
}
Both the top-level keys and the keys inside job are in a different order. Once you sort the object keys and use the same indentation on both sides, the diff gets a lot shorter.
- "status": "queued",
+ "status": "ready",
That's the change I'd investigate. The job ID, retry count, and steps are the same.
Reproduce it in the browser
I built JSON Workbench for this workflow. Paste the original response on the left and the updated one on the right, then click Compare JSON. It formats both documents and sorts object keys at every level. Changes only shows the edited lines, and Full JSON shows the surrounding document. The comparison runs in your browser, and the pasted JSON stays there.
One detail matters here: array order is preserved. If the API returns ["run", "validate"], that should still show up as a difference. The sequence might describe which step actually runs first.
If you try it on a response that produces a confusing diff, I'd be interested in a small, anonymized example.
I used ChatGPT to draft this post.
Top comments (0)