I have an object with specific key-value pairs and I would like to transform it into an array where each item has a label and a value:
{
"id": 12432,
"application": "pashmodin",
"unit": null,
"status": "gholam",
"issueDate": "1999-06-24T00:00:00",
"description": "hasan"
}
The desired array format is:
[
{"label": "id", "value": 12432},
{"label": "application", "value": "pashmodin"},
{"label": "unit", "value": null},
{"label": "status", "value": "gholam"},
{"label": "issueDate", "value": "1999-06-24T00:00:00"},
{"label": "description", "value": "hasan"}
]
How can I accomplish this transformation?