Есть объекты такого вида.
[
{
"user_id": 3,
"json_build_object": {
"bank_props": {
"id": 5,
"user_id": 3,
"organization": "4049725573",
"individual_external_id": "951ac602-55e3-4c44-b35d-560da614052b",
"individual_guid": "951ac602-55e3-4c44-b35d-560da614052b",
},
"settlements": {
"id": 5,
"user_id": 3,
"organization": "2466557538",
"individual_external_id": "951ac602-55e3-4c44-b35d-560da614052b",
"individual_guid": "951ac602-55e3-4c44-b35d-560da614052b",
}
}
},
{
"user_id": 3,
"json_build_object": {
"bank_props": {
"id": 5,
"user_id": 3,
"organization": "4049725573",
"individual_external_id": "951ac602-55e3-4c44-b35d-560da614052b",
"individual_guid": "951ac602-55e3-4c44-b35d-560da614052b",
},
"settlements": {
"id": 6,
"user_id": 3,
"organization": "3198309645",
"individual_external_id": "951ac602-55e3-4c44-b35d-560da614052b",
"individual_guid": "951ac602-55e3-4c44-b35d-560da614052b",
}
}
},
]
Как их объедденить, чтобы на выходе получился объект такого выида
{
"bank_props": [
{
"id": 5,
"user_id": 3,
"organization": "4049725573",
"individual_external_id": "951ac602-55e3-4c44-b35d-560da614052b",
"individual_guid": "951ac602-55e3-4c44-b35d-560da614052b",
}
],
"settlements": [
{
"id": 6,
"user_id": 3,
"organization": "3198309645",
"individual_external_id": "951ac602-55e3-4c44-b35d-560da614052b",
"individual_guid": "951ac602-55e3-4c44-b35d-560da614052b",
},
{
"id": 5,
"user_id": 3,
"organization": "2466557538",
"individual_external_id": "951ac602-55e3-4c44-b35d-560da614052b",
"individual_guid": "951ac602-55e3-4c44-b35d-560da614052b",
}
]
}