Quick question on Json list manipulation.
I have json data that has following format
[
"fruits",
"apple",
"{\n \"color\": \"red\",\n \"harvest\": \"ready\"\n}\n",
"{\n \"color\": \"green\",\n \"harvest\": \"not ready\"\n}\n",
"veggies",
"spinach"
"{\n \"color\": \"green\",\n \"harvest\": \"not ready\"\n}\n",
"{\n \"color\": \"light green\",\n \"harvest\": \"not ready\"\n}\n"
]
I wanted to bring any string that is before "{" (Example: apple and spinach) into into "Key-Value" and add a static "keys" like "name" and "features" to json, finally it would look something like this:
{
"fruits":{"name":"apple",
"features":[
{
"color":"red",
"harvest":"ready"
}",
{"color":"green"
"harvest":"not ready"
]},
"veggies":{"name":"spinach",
"features":[
{
"color":"green",
"harvest":"notready"
},
{
"color":"light green",
"harvest":"not ready"
]}
}