About json compare
Comparing two JSON documents by eye is slow and unreliable. The compare tool shows which keys were added, removed or changed.
Good uses
- Comparing API responses before and after a change.
- Checking differences between configuration files.
- Reviewing test fixtures.
Order
The order of keys in an object does not matter in JSON, but the order of items in an array does. Differences in array order will appear as changes.
A worked example
Comparing {"a":1,"b":2} with {"a":1,"b":3,"c":4} shows that b changed from 2 to 3 and that c was added, while a is unchanged. Keys that moved position but kept their value are not reported, since order does not matter in JSON objects.
Tips for reviewing
Sort arrays that are meant to be unordered before comparing, and be ready for noise from fields such as timestamps and IDs that change on every response.
