Format JSON file using schema
Hello,
Receiving from an embedded micro over Ethernet a JSON file of the form:
{
"id" : 123456,
"ip" : "*",
"t" : -12.9,
"T" : -23.8,
"variables": [
"user1",
0,
12.97,
23
]
}
and knowing what each variable represents in the "variables" array as:
"username" : "user1",
"active" : 0,
"temperature" : 12.97,
"age" : 23
How can I update the JSON file with the key name of the variables such that the end result is:
{
"id" : 123456,
"ip" : "*",
"t" : -12.9,
"T" : -23.8,
"variables": [
"username" : "user1",
"active" : 0,
"temperature" : 12.97,
"age" : 23
]
}
and then be able to access these variables with their name?
Thank you.

