Problem with JsonUnwrapped and Generics in some cases #4837
Replies: 3 comments 8 replies
-
Any chance example could be changed to a unit test? One of the most frustrating things is to have print statements with instruction of "see?". That does not explain anything about the problem or expectations. Having said that, I think it is very likely that But one thing you should try first is what is usually the way to see how things work: start by constructing data structure, serializing, and trying to deserialize that JSON. And see if that JSON output matches your expectations. It is possible structure you have as input is not what Jackson would produce as serialization -- and the general contract is that Jackson should be able to read what it writes. |
Beta Was this translation helpful? Give feedback.
-
As suggested, sharing a project and issue examples as JUnit test cases. |
Beta Was this translation helpful? Give feedback.
-
Oh there's a bug in test: this does not work:
since You can construct type using
because type variables are only used by and visible to Java compiler, not available during runtime (not included in bytecode). Intended target type would be created using something like:
(or passing actual type for |
Beta Was this translation helpful? Give feedback.
-
I am trying to create a generic deserializer for one of my projects. Problem is, when class information is provided via generics, it results in following exception -
Any way to get this working?
Beta Was this translation helpful? Give feedback.
All reactions