So my json data is something like the following,
{
"amazon": []
},
{
"flipkart": {
"product_store": "Flipkart",
"product_store_logo": "logo url",
"product_store_url": "shop url",
"product_price": "14999",
"product_offer": "",
"product_color": "",
"product_delivery": "3-4",
"product_delivery_cost": "0",
"is_emi": "1",
"is_cod": "1",
"return_time": "10 Days"
}
},
{
"snapdeal": []
}
So here I want to loop through each shop and check if it is a jsonarray(amazon) or jsonobject(flipkart) then delete those empty array. And add it to a new array.
Just like the example all keys who have no values like amazon and snapdeal are arrays. And keys with values are jsonObject. I can't change the json.
So I want to know how can I detect JSONObject and JSONArray...
Thank you..