С учетом следующего примера:
foobar: [
{
"foo": {
"title": "example title foo"
"desc": "example description foo"
}
},
{
"bar": {
"title": "example title bar",
"unnecessary": "this is not needed"
"desc": "example description bar",
}
}
]
Как отформатировать этот массив, содержащий объекты, чтобы получить следующий результат:
[
{"example title foo": "example description foo"},
{"example title bar": "example description bar"}
]