I am using a third party API which gives me a JSON response as follows.
{
"peopleList":[
{
"name":"Jack",
"creditcard":"12335435345"
},
{
"name":"Arya",
"creditcard":""
}
],
"responseTime":0.02,
"error":""
}
Here the empty string is used to represent No Value
, which I think should have been null.
How do I replace all the values that are empty-string to null using python?
Edit:
I am using Django to serve JSON to my iOS app which is in Swift. Although empty string is false in python it is not the case in swift.
Or even better. How do I remove all the keys which have empty-strings as their value?