You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
findDeserializerFromAnnotation will resolve, but not contextualize, the resulting Deserializer. Subsequently, in PropertyBasedCreator#construct, we will construct a contextualized Deserializer if and only if a Deserializer is not already present:
if (!prop.hasValueDeserializer()) {
prop = prop.withValueDeserializer(ctxt.findContextualValueDeserializer(prop.getType(), prop));
}
This fails, however, as our Deserializer was never contextualized.
If this is indeed a bug, I think a simple fix may be to simply contextualize the Deserializer within PropertyBasedCreator#construct if it's present. Let me know if that is a good solution; I can make a PR if desired.
The text was updated successfully, but these errors were encountered:
Yes, it sounds like a bug: all serializers/deserializers should be contextualized (when used for a property, i.e. when there is a context). Thanks; I will fix this.
Added a call to contextualization; will be in 2.3.4 / 2.4.0. If you have a chance to verify from either, that'd be great, but I assume that problem is resolved.
I have verified the fix in 2.3.4-SNAPSHOT. Thanks a bunch for the quick patch! @JsonDefaultValue is now more easily implementable for the Scala case class junkies among us... :)
On this line within
BasicDeserializerFactory#constructCreatorProperty
, we create a Deserializer based on an annotation:(source)
findDeserializerFromAnnotation
will resolve, but not contextualize, the resulting Deserializer. Subsequently, inPropertyBasedCreator#construct
, we will construct a contextualized Deserializer if and only if a Deserializer is not already present:(source)
However, this returns false because we do have a value deserializer.
Finally, we attempt to deserialize using this PropertyBasedCreator, within
BeanDeserializer#_deserializeUsingPropertyBased
:(source)
This fails, however, as our Deserializer was never contextualized.
If this is indeed a bug, I think a simple fix may be to simply contextualize the Deserializer within
PropertyBasedCreator#construct
if it's present. Let me know if that is a good solution; I can make a PR if desired.The text was updated successfully, but these errors were encountered: