- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.4k
Description
Search before asking
- I searched in the issues and found nothing similar.
Describe the bug
NullValueProvider return Object
JsonDeserializer return T
Interestingly, getAbsentValue returns Object in both.
I'm hitting a real world issue in Scala. Scala 2.11 and 2.12 cannot handle the mixed typing and won't let me override getNullValue in jackson-module-scala. Scala 2.13 and Scala 3 are ok. Unfortunately, we need to support older Scala releases.
One option is to say that it might break things to chnage the signatures in Jackson 2 but could we consider changing Jackson 3 to make NullValueProvider<T> and to have getNullValue and getAbsentValue to return T?
I have a possible solution for Jackson 2 that I would suggest is a temp solution on Jackson 2 that does not get forward fit to Jackson 3. Jackson 3 only gets the NullValueProvider<T> change. In Jackson 2, we could add a JsonDeserializer method called with withNullValueProvider which returns a new JsonDeserializer instance that uses the provider from withNullValueProvider. This change is one that I'm entirely sure about.
Version Information
All recent versions