On this page
To find what changed in a JSON API response, save an earlier and a newer response for the same case, check that both are valid JSON, and compare their values. Review the paths reported as additions, removals, or changes against the API contract. The comparison shows differences between these two samples; deciding whether one is a regression takes knowledge of the expected behavior.
1. Capture responses you can compare
Use the same endpoint, method, parameters, and data context before and after the change. Comparing different orders can produce differences unrelated to a deployment. Keep the HTTP status code and any context you need to interpret the response too: the diff examines the JSON bodies you paste into it.
Replace tokens, personal data, and other secrets before copying a response into any tool. Generated IDs and timestamps can differ between requests and still be expected. If they appear, review them separately; JSON Diff does not ignore them automatically.
Both captures must be strict JSON. If either contains comments, trailing commas, or a syntax error, correct it and check it with the JSON validator before interpreting differences.
2. Compare the before and after bodies
Here are two fictional captures for the same order A-17. Before:
{
"order": { "id": "A-17", "status": "pending" },
"lines": [{ "sku": "CU-1", "quantity": 1 }]
}
After:
{
"lines": [{ "sku": "CU-1", "quantity": 2 }],
"order": { "status": "paid", "id": "A-17" },
"shipping": null
}
Paste the first capture into Previous JSON and the second into New JSON in JSON Diff. Select Compare, then read the summary and paths. Reordering the object keys does not add a difference.
| Path | Type | Before → after | What to check |
|---|---|---|---|
$.order.status |
Changed | "pending" → "paid" |
Was this status expected for the order? |
$.lines[0].quantity |
Changed | 1 → 2 |
Was this quantity expected for the same line? |
$.shipping |
Added | Missing → null |
What does the new property mean to clients? |
The summary is 1 addition, 0 removals, and 2 changes: 3 differences total. A removal would mean a property or item from the earlier body no longer appears. shipping counts as an addition even though its value is null: the property was previously missing. The lines array is compared by position, and [0] identifies its first item.
If an array insertion produces several changes, or a missing field and null seem interchangeable, see how to interpret a JSON diff.
3. Decide what needs investigation
Check each path against the API contract and tests. The paid status may be intended; a quantity changing from 1 to 2 calls for a check of the input data and order rules. For shipping, find out whether clients distinguish a missing property from one present with null. Adding a property alone does not prove compatibility or a breaking change.
If you confirm a regression, record the case and add or update an assertion in your API tests. If the comparison shows no differences, you only know that these two JSON bodies compared equal by value. That does not establish identical behavior for other requests, headers, or API operations.