-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
Remove MissingKotlinParameterException and replace with MismatchedInputException #617
Comments
From the following |
@cowtowncoder |
@k163377 I do not have enough knowledge to give strong opinion, but it does sound good to me. So please proceed if it makes sense to you. |
@k163377 Is the idea to change exception used in 2.15, deprecate old one (not used but left in-place), then remove from 2.16. Because that sounds like a reasonable plan to me. |
Yes. |
@k163377 Sure, deletion may or may not occur. But there should be one issue closed, for changing exception (like this one) so it can be added in release notes; and then another one for deletion if any (leaving open until and if it is done). |
Would it be possible to keep |
@remen For example, you can check the detailed path by doing the following class Class @JsonCreator constructor(@JsonProperty(value = "value", required = true) val value: String)
fun main() {
val mapper = ObjectMapper()
try {
mapper.readValue<Class>("{}")
} catch (e: MismatchedInputException) {
println(e.pathReference)
}
} The example shows getting |
I have tentatively incorporated this change for 2.16. |
Replacing If |
Quick note: perhaps it'd make sense to add a replacement subtype of |
Indeed, the biggest problem is the What I am struggling with is whether to keep it simple and just revive it or make a few more changes. First, the name The next is whether the superclass should be changed to Personally, I am thinking of adding a new WDYT @cowtowncoder ? |
@cowtowncoder I am sorry to bother you, but here is a reminder. |
@k163377 Sorry, thought I had added comment here. Thanks for reminder. So, yes, it all makes sense as explained, including use of |
@cowtowncoder Regarding I plan to implement the following converter in the future to speed up the null check ( |
Yes I would be ok to get PR that allows |
Sorry to change my previous statement, but I will not be making this change in 2.16 and will continue to consider it in 2.17. The discrepancy between the With the imminent release of 2.16 and not enough time to establish an overall policy, I would prefer to postpone a decision. |
Sounds reasonable. About the only is that unless already done, maybe marking |
@cowtowncoder |
@k163377 Yes, that looks good to me. Thanks! |
I'm a bit late, but just wanted to chime in and let you know my preference would be a replacement exception which contains the missing parameter name (as a couple of others have suggested). |
I'm interested in a replacement exception as well - is this still on the table? |
PR referenced was merged -- so maybe this is already included in 2.17? |
I have not been able to fully address this issue as a result of a combination of personal circumstances. It is difficult to address even in 2.18 and will be considered in 2.19 or later. |
@k163377 Ok that is fine, I just wanted to know if the issue is still alive: it is. Is the description still accurate as to what is needed? It seems like |
From the Input Validation Requirement perspective,
|
As @im-bravo and @mzeijen said,
I would also echo the |
Any update here? |
I apologize for not addressing this issue as I have been extremely busy. Here is what I plan to do. With respect to deprecating
This destructively changes the error thrown when |
This change was originally scheduled to take place in 2.16, but later discussions postponed the decision to the 2.17 transition.
If the work on removing
kotlin-reflect
is reflected injackson-module-kotlin
, theMissingKotlinParameterException
change is unavoidable since it referencesKParameter
.#450
The same applies to resolving the following issue
#572
I have also found a way to significant improve performance when the
strictNullChecks
option is enabled, but it is difficult to avoid changing error messages when enabling this option as well.ProjectMapK/jackson-module-kogera#44
So, remove
MissingKotlinParameterException
and replace it withMismatchedInputException
(MismatchedInputException
is a superclass ofMissingKotlinParameterException
).This removal process will be done in phases, with deprecation in 2.15 and removal in 2.16.
The text was updated successfully, but these errors were encountered: