-
Notifications
You must be signed in to change notification settings - Fork 117
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
Cannot read Optionals written with StdTypeResolverBuilder #86
Comments
Added workaround, involving copy&pasting classes from 2.8.11 - https://github.com/isopov/jackson-optional-test/blob/workaround/src/test/java/com/example/OptionalJacksonTest.java Still proper fix will be highly appreciated. |
I will have to say that it is quite possible that combination of polymorphic type in In fact I am considering adding a warning that polymorphic type handling is not recommended to be used for root values at all. Having said that: I will try to figure out if this can be made to work correctly (although depending on changes they might only be made to 2.9 branch), and I hope this is the case. Thank you for reporting the problem. EDIT Looking at this further, |
To help future work, output looks like:
and that would seem to be missing type information for contents, somehow. |
@JooHyukKim this might be worth looking into as well. |
Ah so this is how we want the output object is in 2.8. {
"com.fasterxml.jackson.datatype.jdk8.OptionalStdTypeResolverBuilder86Test$Foo": {
"bar": {
"java.util.Optional": 1
}
}
} If we try to read above JSON output from 2.8, in later version, throws error saying...
|
Hmmmh. Now that I think about this, there's a problem... Although we do need the type id of the contained value, we also need to know there's I also realized that the test case is incomplete; it doesn't seem to verify actual contents. |
The following test fails on Jackson 2.9.7 and passes on 2.8.11:
Complete runnable project with this test-case can be found on https://github.com/isopov/jackson-optional-test
The text was updated successfully, but these errors were encountered: