Flatten nested JSON with jq Flatten nested JSON with jq json json

Flatten nested JSON with jq


Well the data you're attempting to flatten is itself JSON so you have to parse it using fromjson. Once parsed, you could then generate the new objects.

map({id} + (.officers | fromjson[]))