-
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
Regression on data binding in 2.11.0 with specific field naming #340
Comments
Kotlin issue, needs to go under Kotlin module issue tracker; will transfer. |
Hello, I'am facing exactly the same issue. Though in my project the constructor value provided is skipped and default value is used. I prepared sample project if it may help: As already noted everything is fine in 2.10.4 I think it may have the same root cause as #337 |
Just FWIW for anyone following up with this issue, Spring Boot 2.3.1.RELEASE still shows the same problem, but it's still using Jackson 2.11.0, so that's not surprising. I tried bumping |
Yeah, made a simple test that doesn't use Spring Boot, just Kotlin and Jackson, using the test above. Problem still visible. If anyone wants to have access to the project so you can validate, happy to put it up on GitHub. |
@geoffreywiseman Would you put that repro up & link it here? I'll take a look. |
A simple project demonstrating the problem that I described in FasterXML/jackson-module-kotlin#340. Signed-off-by: Geoffrey Wiseman <[email protected]>
Branched to work on this, just a test right now, I'll update when there is progress. https://github.com/FasterXML/jackson-module-kotlin/compare/github-340-is-field |
Notes:
|
I've done a bit of work on this branch but haven't come to a solution. I pulled part of the noted commit that changed KotlinNamesAnnotationIntrospector, which fixes this issue but breaks tests |
Hey, @dinomite -- assume this still hasn't changed? I've just tested Jackson versions up to v2.12.1, and still seeing the same behavior. I definitely don't know the internals, so I'm not sure I can help with your Sep 1 comment. :/ |
@geoffreywiseman Correct, no movement on this :-/ More digging on the interaction of naming determinations between j-m-k & Jackson databind is required. |
|
Because problems like FasterXML#340 occur when using findRenameByField
A fix for this issue will be released in 2.15. |
For what it's worth, I was cleaning out some old bug reproduction repositories and re-checked my reproduction against |
Dependabot suggested an upgrade from Spring Boot 2.2.7 to 2.3.0, but the build failed; I checked it out and had the same failures. It looked like a Jackson issue, so I went back to Spring Boot 2.2.7 with Jackson 2.11.0, the version used in Spring Boot 2.3.0, and had the same problem.
I'm having this problem in a Kotlin project, but using Jackson-module-kotlin 2.11.0 alone doesn't seem to cause the problem.
I'm having the same problem in two places, the problem seems to be about the same in each case. It's roughly something like this: I have an API request object that can come in multiple forms, say, an
owner
that can be a person or organization. SoOwnerRequest
has anorganization
property, but it also has a private internal valisOrganization
that returns a boolean if theorganization
field is set.e.g.
I can see how there's a risk of confusion here, since Kotlin exposes getters and setters for Vals, and by java bean standards
is<Property>
could be a boolean getter for a a property. But in Jackson 2.10.4, all behaves as desired, and there hasn't been a problem.However, if I replace 2.10.4 with 2.11.0, now there's a problem. Suddenly, the server is responding as if
organization
wasn't set (triggering a validation failure).As a reproduction, this test:
passes in 2.10.4 and fails in 2.11.0.
Here's the failure:
The text was updated successfully, but these errors were encountered: