I am having a dynamic json (data) in python coming from a service, the service also gives me a dynamic string data keyToDelete where I will get the object to delete
for Example 1 lets say if the data value is as given below
{
"categories": {
"attributes": {
"Alcohol": "full_bar",
"Noise Level": "average",
"Music": {
"dj": false
},
"Attire": "casual",
"Ambience": {
"romantic": false,
"intimate": false,
"touristy": false,
"hipster": false
}
}
}
}
which means it should delete the Ambience object that comes under attributes, actual result should be like
{
"categories": {
"attributes": {
"Alcohol": "full_bar",
"Noise Level": "average",
"Music": {
"dj": false
},
"Attire": "casual"
}
}
}
but how to create the above deletion programmatically using python from dynamic keyToDelete
Can anyone please help me on this
