Reputation: 133
I use FastJSON to deserialize a json into an object. During the deserialization I would like to automatically replace all the null values in the json by an empty string. Is there a JSON parameter to do that? Otherwise, what would you suggest?
Upvotes: 0
Views: 1393
Reputation: 93
You can use JSON.parseObject(String json, Class<T> clazz, Feature... features)
method and pass through Feature.InitStringFieldAsEmpty
as last argument.
Upvotes: 1