Ok: JVM `null`s do not get much love. There are many null-hates,
discrimination. So, with heavy heart (for I do not do that!), I concur that
maybe Jackson ought to do something to allow further discrimination of null
values, besides on constant flow of all kinds of proposals.

My idea-of-the-day is as follows: what if there was a way to do something
like

public class POJO {
     @JsonFormat(without=JsonFormat.Feature.ALLOW_NULL_ASSIGNMENT)
    protected String name = "N/A";
}

which, upon deserialization encountering:

{ "name" : null }

would just ignore that value?

Would this be considered useful? If so, we could also add hierarchic system
to allow:

1. Global default (to have by default rule of no null assignments)
2. Per-type overrides (via configOverrides() added in 2.7)
3. Per-property overrides via JsonFormat

Which, I suspect, would cover lots of null-avoidance use cases (*)

WDYT?

-+ Tatu +-

(*) and no doubt spring new ones like "ignore not just nulls but also Empty
String; number 0; or Date of today" offshoots. But one problem at a time

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jackson-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to