I have the following data-structure:
{
"Category": "cars",
"Limit": "10",
"Properties": [
{
"value": "red",
"key": "colour"
},
{
"value": "bmw",
"key": "make"
},
{
"value": "estate",
"key": "body"
}
],
"Offset": "0"
}
I need to rebuild it so that it looks like this:
{
"Category": "cars",
"Properties[0][key]": "colour",
"Properties[1][key]": "make",
"Properties[2][key]": "body",
"Properties[2][value]": "estate",
"Properties[0][value]": "red",
"Limit": "10",
"Offset": "0",
"Properties[1][value]": "bmw"
}
Rather than re-inventing the wheel, are there any utilities that can assist here ? Or can somebody please provide some best advise regarding the best way to achieve this.