I want to delete the JSON key which contains empty object inside an array...
This is my JSON structure:
{
    "CreateSubnet": {
        "description": "Creatingasubnet.",
        "input": {
            "body": {
                "subnet": {
                    "network_id": "sdfsdfds",
                    "ip_version": "sdfdsfs",
                    "cidr": "sdfsdf",
                    "allocation_pools": [
                        {}
                    ]
                }
            }
        },
        "action": "neutron.create_network",
        "publish": {},
        "on-success": []
    }
}
Please help me to delete the element "allocation_pools"..
I never want this key and this value ...
The expected output JSON will be look like...
{
    "CreateSubnet": {
        "description": "Creatingasubnet.",
        "input": {
            "body": {
                "subnet": {
                    "network_id": "sdfsdfds",
                    "ip_version": "sdfdsfs",
                    "cidr": "sdfsdf"
                }
            }
        },
        "action": "neutron.create_network",
        "publish": {},
        "on-success": []
    }
}
Note this JSON is from external source it changes dynamically...
So please tell me how to validate the JSON key contains Array...
if yes , Check whether it has empty object or not ....
This is my question
 
     
    