Records with a nested object
Input
[{"id":1,"user":{"name":"Ada"},"active":true},{"id":2,"user":{"name":"Bob"},"active":false}]Output
id,user.name,active
1,Ada,true
2,Bob,falseThe nested user object becomes a user.name column.
Turns { "user": { "name": x } } into a user.name column.
Further reading
CSV is a flat grid; JSON can be a tree. This converter flattens nested objects into dotted columns by default and ordinarily pads missing fields with empty cells. Flattening can overwrite colliding paths and drop empty nested objects. Warnings cover some transformations, not every assumption or loss, so compare the result with the source before relying on it.
The usual goal is getting JSON into a spreadsheet, a BI tool, or a bulk-import form. Those all want one header row and a consistent column count, which is exactly what this produces.
Each example below is executed against this tool by the test suite, so what you see is what the tool actually produces.
Input
[{"id":1,"user":{"name":"Ada"},"active":true},{"id":2,"user":{"name":"Bob"},"active":false}]Output
id,user.name,active
1,Ada,true
2,Bob,falseThe nested user object becomes a user.name column.
Input
[{"a":1,"note":"x, y"},{"a":2,"b":3}]Output
a,note,b
1,"x, y",
2,,3Every row has three fields. The comma-containing value is quoted; missing values are empty.
The details that decide whether a conversion is correct, and where information can be lost without any error being raised.
Turn a CSV table into a JSON array of objects.
Turn JSON into well-formed XML with a configurable root element.
Turn JSON into readable YAML for config files and manifests.
Turn JSON records into an aligned Markdown table.
Generate INSERT statements from JSON records.