-
-
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
If the property is required
, the absentValue
is ignored and a MismatchedInputException
is thrown.
#4201
Comments
Makes sense |
@JooHyukKim By the way, why is the |
I agree, that in common logical sense |
I see, LGTM. |
True, added such comment accordingly. 🙏🏼 |
Thanks a lot! |
Hmmh. Apologies if I am missing something obvious but If I understood this correctly, then resolution would be "works as designed". |
Will close, although am willing to hear counter-arguments if there are some. |
Sorry for the late reply. Personally, I think it would be more natural for |
@k163377 It sounds like perhaps Kotlin module is considering/using Does Kotlin module's |
@cowtowncoder As you say, there is a difference in semantics here.
A strict application of the policy would be that On the other hand, this implementation has a very long history, and the extent of the impact of a destructive change is not known. Also, since most of the time no absent value is provided by If the impact on existing is to be kept to a minimum, it would be preferable to relax the |
At this point I do not want to change semantics of So adding such I am open to other ways to allow Kotlin module to change behavior for just types it handles; but do not want changes for "regular" non-Kotlin POJO handling. |
First, changing the implementation of Secondly, such a change in behavior basically only affects deserialization related to classes defined in For these reasons, I personally do not think this behavior should be changed. |
Sigh. Ok, too bad this wasn't caught earlier. So I guess behavior of Kotlin module will and need to remain different in this regard. Still, as I said, I am open to |
Search before asking
Describe the bug
If the property is
required
, theabsentValue
is ignored and aMismatchedInputException
is thrown.Version Information
2.15.3
Reproduction
Expected behavior
If
absentValue
returns a non-null value, then processing should continue.Additional context
By organizing these priorities, we believe that the deserialization process in
kotlin-module
can be written easily and without differences in behavior.https://github.com/FasterXML/jackson-module-kotlin/blob/fc47a94e81586990dd19d05087580652c14b7f7a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinValueInstantiator.kt#L75-L89
The text was updated successfully, but these errors were encountered: