-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
Java Bean naming conventions not respected for boolean properties -> Incompatibility with standard Jackson ObjectMapper #291
Comments
Is there any solution for this? |
My understanding is that Java reflection does not give deterministic ordering of parameters. And JSON parsers generally don't care too much about the order of the parameters. If someone wants to submit a patch, feel free but I'm not planning to prioritise work on this. |
I think there may be two different issues: one is that test itself is bit fragile as order of properties is not specified and (as @pjfanning correctly points out) order of fields, methods is not guaranteed to be declaration order. For repeatable tests it should be necessary to either force ordering (using The other one, main question I assume, is whether logical property discovery should vary between default databind and Scala module: it seems that there is difference, possibly unintentional one? |
#455 might help - scheduled for 2.12.0 release. If you have time, try out 2.12.0-SNAPSHOT. |
Yes, they are two different issues. What I assumed this ticket talking about is, after adding @pjfanning I tried to test it with 2.12 SNAPSHOT but could not find jackson-module-scala_2.13 in sonatype repo. |
https://oss.sonatype.org/content/repositories/snapshots/com/fasterxml/jackson/module/jackson-module-scala_2.13/2.12.0-SNAPSHOT/ -- if you use sbt, add this to build.sbt
|
Observed the same problem with 2.12 as well. The |
I am closing this - 3f3e818 seems to indicate that this works in jackson 2.12.x and above. |
If the field name of a boolean Java Bean Property differs from the name of the getters and setters and starts with "is" it is serialized wrong. This does not follow bean naming conventions and is incompatible with an ObjectMapper used without the Scala module. Here's a Spock specification to show the problem (the second test may occasionally fail due to ordering of properties):
The text was updated successfully, but these errors were encountered: