-
-
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
Case classes with option types don't follow serialization configuration #32
Comments
Thanks for the bug report, I'll take a look at why the works for normal classes and see what needs to be added to the case class logic. |
While I haven't yet worked out a way to support this using |
Reopening, as I realize now that this issue is slightly different than #9. |
I added what I think is a functionally equivalent pair of tests to |
Well it looks like my tests were bad. Reopening as I've fixed the tests and the problem still exists. |
Ok, filing in some more information so I don't forget it.
I should have a fix for this shortly. |
With jackson 2.1.0 and jackson-module-scala 2.1.1-SNAPSHOT: case class Foo(val a: String, val b: Option[Int] = None) @RunWith(classOf[BlockJUnit4ClassRunner]) @test Prints: {"a":null,"b":null} Am I missing something? |
Nope, my tests are bad, #45 also reported this. Will fix ASAP and issue a 2.1.1 for it. |
This issue should be resolved in 2.1.1, just released. |
Yes, works for me correctly now. Thanks for the quick turnaround! |
This seems to be broken again in 2.7.4 and 2.7.5. I setup my ObjectMapper using
and the following test fails
|
Seems still broken in 2.8.3 as well |
is there a workaround for this ? |
Use |
I'm trying to keep jackson from writing the None Option value as "null". I believe the scala module is not honoring the serialization conf. In the following test case, the first two tests fail because they are returning
{"foo":null}
despite the mapper being configured to include only non-null values. The third is not a case class and passes with the expected response of "{}":which returns:
The text was updated successfully, but these errors were encountered: