-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
in some cases serialization of option is not working #398
Comments
Is there any chance you teased out what kind of types (static inner classes, anonymous inner classes, etc) it fails to serialize? |
It was simple types like Boolean and Int (Option of them) |
I doubt it is that simple. We have tests that pass on all released versions of this module that specifically serialize Is there any chance you were using an |
I don't think so. It looked like a race condition, because it didn't happen to the type on all mapping but only on specific methods. |
Race condition, in that sometimes a singular code path would serialize correctly and other times it would not? What version of scala are you using? Do you still observe this issue? |
It's more looks like a race condition on construction time because when it fails for a specific endpoint it will constantly fail on that. However, it wasn't failing on all entities with that type and we also have few instances of the service and it failed only on a couple of them. Scala version is 2.11.7. |
If you can tease out a toy program that (when run enough times) will eventually fail, then I would be happy to investigate further. Otherwise, I am not aware of any inherent race conditions in scala 2.11.x - so I'm not even sure what would be an appropriate scenario to try. |
Unfortunately, we didn't manage to reproduce it. |
@plokhotnyuk, I see your |
One thing that might help is that we reverted to 2.6.5 and don't see the issue anymore. |
That slightly helps ... in that the code paths for |
@nbauernfeind the working w/a for me is using jsoniter-scala instead - it generates codecs at compile time and can print their sources for validation, like here |
Hi guys I have the same problem, not had time to extract it to a simple test yet as gotta just revert the version bump to get into prod, but this is what I know so far. The bug can manifest rendering a simple DTO that contains two scala Option[Long] both Some(..)'s A simple test of my WebRestObjectMapper (see below) does not have a problem.
the FunSpec test looks like `/** test for Bug ParentId is an Option[Long] but sometimes represents like
}` However when using Spring WebMVC (version 4.3.5.RELEASE ) vial a Controller the error manifests.
on line PropertySerializerMap.java:279 the second time it is the I do not know why the Hope this helps someone to fix it. Cheers |
Hey guys, We would like to upgrade to scala 2.13 and use the latest jackson-module-scala version which supports it. Any news about this issue? we are in concern about upgrading to the latest version when this issue still exists. Thanks a lot! |
@galando Github issues are not good discussion forum: please use mailing list: https://groups.google.com/forum/#!forum/jackson-user for questions like this. |
Thanks @cowtowncoder for the clarification. |
I noticed the email so maybe others can comment there, but 2 other things:
|
We are using jackson 2.9.8.
Sometimes (we couldn't find any consistent case) it ignore option (like scala module is unaware of option and just writing a json like this:
{"x":1,"empty":false,"defined":true}
(in this case this is an option of int).
The text was updated successfully, but these errors were encountered: