-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
To write null String as "", write null Collection or array as [] #1815
Comments
I am not sure how this could be achieved in a way compatible with existing configuration operations. Your best choice currently is probably use of I will keep this open in case someone has good ideas on how this should be exposed via API since that is the big challenge. |
@bungder have you tried |
@rfoltyns Yes, but it just made null properties disappeared |
Can there be a serialization flag similar to the ones here: https://github.com/FasterXML/jackson-databind/wiki/Serialization-features#datatype-specific-serialization As per the annotations, deserialization already has this pretty nice annotation / property: Are these all bigger API changes that require 3.x? |
I do not think adding new Also, for specific case of https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-3 |
Hi Jackson community!
Our front-end colleague do not want to get null from back-end, and I tried to overwrite some kinds of null as default values. Here are 3 kinds of them: String, Collection and array. And I have tried some approaches, like setNullSerializer, overwrite CollectionSerializer, but not fits well.
Another way to achieve this is using reflection to replace a default value to null properties before serialization, but I don't prefer this because it would reduce server performance.
It seems to be a common requirement. So it would be great if jackson supports this feature.
The text was updated successfully, but these errors were encountered: