I have a json file in the following format:
{
"foo": {
"type": "string",
"value": "hello"
},
"bar": {
"type": "string",
"value": "goodbye"
}
}
I want to transform it to:
{
"foo": "hello",
"bar": "goodbye"
}
Best I have got to:
cat file.json | jq 'to_entries[] | reduce . as $item ({}; reduce . as $value ({}; $item.key + ":" + $item.value.value))'
which gives:
"foo:hello"
"bar:goodbye"
close, but still a long way to go.
All assistance appreciated. Thanks.