Here is my Json File:
{
"models":{},
"path":[
{
"path":"/web-profiles",
"operations":[
{
"type":"",
"responseMessages":[]
}
]
}
],
"produces":[]
}
If the values of keys are empty (includes [], "", {}). How can I remove those pairs from Json file.
- I tried to use JSONObject build-in functions to remove unnecessary pairs. But, it didn't work.
- I tried to use string method to process it line by line. It got too many cases, I can't cover all of those cases in my code. (for example, the sub-key 'operations', when you want to remove all empty value, this key(operations) value pair also should be removed.) Any ideas?