How to Debug an API JSON Response
Most “the API is broken” incidents are a field that changed type, a field that went missing, or a null nobody expected.
Working notes on the parts of JSON that actually cause problems — parse errors, schema evolution, array diffing, type inference and the Excel behaviours that quietly corrupt a CSV export. Each article links to the tool that does the job.
Most “the API is broken” incidents are a field that changed type, a field that went missing, or a null nobody expected.
Generated types are inference from evidence. The quality of the output is entirely determined by the quality of the sample.
A generated schema describes the sample you gave it. A useful schema describes the agreement you actually want to enforce.
CSV is flat and JSON is a tree. Everything difficult about the conversion follows from that one sentence.
JSONPath is XPath for JSON: a compact way to say “every email address in this document”, whatever shape it is in.
Reorder a few keys and `git diff` says every line changed. A structural diff says nothing changed — because nothing did.
JSON for machines, YAML for humans — with a short list of YAML behaviours that have caused real outages.
“Unexpected token } in JSON at position 582” is a true statement and a useless one. Here is how to get from it to the actual problem.
Formatting changes nothing but whitespace — which is exactly why choosing the right moment to do it matters.
JSON is small enough that its entire grammar fits on one page — which is exactly why the edge cases catch people out.