An API can still return valid JSON after a change that breaks its clients. For example, a new response might put items under data while an older client reads it at the root. A small fixture makes that kind of change visible without sharing customer records.
Prepare two synthetic responses
{"items":[{"id":"A17","available":true}],"next":null}
{"data":{"items":[{"id":"A17","available":true}]},"next":null}
Format one line at a time and compare the indentation. In the first response, items[0].id is present. In the second the same value is at data.items[0].id. Both documents should format successfully.
Verify what the client consumes
- Write down the old and new field paths.
- Test a populated array and an empty array in the actual client.
- Check
nextindependently. An explicit null and a missing field can trigger different behavior.
Keep the synthetic response with the regression test. Pretty-printing checks the JSON structure visually. The client test verifies the contract.