Why a text diff is the wrong tool for JSON
A line-based diff compares sequences of characters. It has no idea that `{"a":1,"b":2}` and `{"b":2,"a":1}` are the same value, so it reports two changed lines where nothing changed. Reformat a file and every line differs. Reindent it and the whole document is a change.
A structural diff parses both documents first and then compares the resulting values. Objects are matched by key, so ordering is irrelevant. Whitespace is gone before the comparison starts. Numbers are compared by value, so `1.0` and `1` are equal. What you get back is a list of semantic differences: keys added, keys removed, values changed.
That difference in approach is why a structural comparison of two API responses is usually a handful of lines while a text diff of the same pair can be hundreds.