My json Array structure is as follows:
[
{
"pos1": "Batterie de préchauffage",
"attributes": [
{
"disconnect": "false",
"disconnectBis": "false"
}
]
},
{
"pos4": "Batterie haute température",
"attributes": [
{
"test": "true",
"testBis": "false"
}
]
},
{
"pos3": "free"
},
{
"pos2": "free"
}
]
I am looking to rearrange my json data to achieve the following format:
[
{
"pos1": "Batterie de préchauffage",
"attributes": [
{
"disconnect": "false",
"disconnectBis": "false"
}
]
},
{
"pos2": "Batterie haute température",
"attributes": [
{
"test": "true",
"testBis": "false"
}
]
},
{
"pos3": "free"
},
{
"pos4": "free"
}
]
I need to ensure that the 'pos' values are in progressive order.
I hope someone can understand my issue and provide guidance on how I can resolve this problem. I have searched extensively but haven't found a solution specific to my situation.
Thank you for your help!