-
-
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
Nulls
property metadata ignored for creators
#2458
Comments
It sounds like a bug. What would be super useful is a simple unit test to show the problem, might be easy to fix. |
databind 2.9.9.3
|
Thanks! |
Ok, so looks like It looks like there is already a loop for checking "missing" properties, which seems like the place to do call for |
Ok. Looks like wiring of above is actually quite easy: This is pretty severe shortcoming as it looks like case of null-value conversion is only tested via setter/field, but not constructor parameters. Clear oversight from 2.9 tests for the new feature. |
Looks like somehow Also found #2280 that is perhaps related... |
Ok. I think I see what is happening. It is in fact due to different construction paths. For non-creator properties, |
Nulls
property metadata ignored for creators
I'm using jackson databind 2.9.9.3.
I'm trying to deserialize object with creator. I've set
But jackson tries to put null instead of empty set in my constructor.
I debugged jackson and found, that jackson calls
BasicDeserializerFactory#constructCreatorProperty
to get constructor argument property(classCreatorProperty
).This class holds
ProperyMetadata
, which is used later to handleNulls
value.PropertyMetadata
constructed usingPropertyMetadata.construct
method (line 1066 in source code in IDE or https://github.com/FasterXML/jackson-databind/blob/master/src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java#L930 in current)This call does not fill
_valueNulls
and_contentNulls
. Looks like JsonSetter annotation and defaults are completely ignored for constructor arguments.Is this intended? How can i prevent jackson from putting nulls in my contructor?
The text was updated successfully, but these errors were encountered: