firstly thank you in advance I am having a lot of trouble with this one.
I am calling an API which sends back JSON in a really bad format. There seems to be arrays within arrays. How can I convert this into JSON objects so that the string is the @id and the value is "$"
{"cake-response-list": {
"@error": "EndOfResults",
"@throttle": "712",
"@total-cakes": "712",
"cake-responses": {
"cake.model": [
{
"@mh": "0x1111111",
"ns1.attribute": [
{
"@id": "0x22222",
"$": "ChocGateux"
},
{
"@id": "0x33333",
"$": "ChocMud"
}
]
},
{
"@mh": "0x4444444",
"ns1.attribute": [
{
"@id": "0x55555",
"$": "VanillaSponge"
},
{
"@id": "0x66666",
"$": "RaspberryCheesecake"
}
]
},
{
"@mh": "0x7777777",
"ns1.attribute": [
{
"@id": "0x88888",
"$": "ChocEclair"
},
{
"@id": "0x99999",
"$": "StrawCheesecake"
}
]
}
]
}
} }