JSON handles nesting and arrays naturally; CSV is flat. Pipelines flatten nested API responses into tables, then humans open the CSV in a grid. Misparented flattening shows up as duplicate keys or JSON blobs inside cells.
Flattening discipline
- Pick repeatable paths for arrays (explode to rows or aggregate).
- Keep stable column names across API versions.
- Validate row counts vs. API pagination totals.