如何在json中值为空时删除键

时间:2017-01-10 09:17:42

标签: json

我希望在JSON中值为null时删除键(例如使用JAVA)

"attributes": {
                        "csapDescriptionOfNart": {
                            "values": []
                        },
                         "cpimCustomerWishDateOfDelivery": {
                            "alias": "Customer Wish Date Of Delivery",
                            "values": [{
                                "value": "12/21/2016",
                                "source": "SAP",
                                "locale": "en-us"
                            }]
                        }
}

此csapDescriptionOfNart必须删除

"attributes": {
                        "cpimCustomerWishDateOfDelivery": {
                            "alias": "Customer Wish Date Of Delivery",
                            "values": [{
                                "value": "12/21/2016",
                                "source": "SAP",
                                "locale": "en-us"
                            }]
                        }
}

0 个答案:

没有答案