Closed cgendreau closed 10 years ago
This is bit tricky to do, but others have expressed similar desire for more granular null serializer configuration.
So it's just question of how to do this efficiently, also considering that code to handle this is scattered over multiple structured serializers (Map, List, array serializers at least, in addition to BeanSerializer
).
Oh. Also, this should be filed at jackson-databind -- annotations project is only about adding annotation property, and in this case that is trivial compared to making things actually work.
It looks like a custom
@JsonSerializer
will never be used with null values even if@JsonInclude(Include.ALWAYS)
is used. I guess the null handling is at the ObjectMapper level but it would be nice to provide custom null handling at field/getter level. Maybe a@JsonNullSerializer
or another parameter on@JsonSerializer
?