I have an older framework class that is annotated with jackson 1.x. My application uses jackson 2.0 to handle json serialization. Is it possible to configure jackson 2.0 to understand the "old" annotations? currently these annotations are simply ignored.
There is no out-of-the-box configuration, but it should be quite easy to implement Jackson 2.0 AnnotationIntrospector (possibly extending JacksonAnnotationIntrospector
) and make it use Jackson 1.x annotations in addition to or instead of 2.x annotations.
In fact, you could basically just take 1.x JacksonAnnotationIntrospector
and replace its usage.
The reason 2.0 does not and will not support 1.x annotations directly is that it would pull in additional dependencies, and probably cause version conflicts. But that does not prevent external libraries from doing this -- in fact, if anyone wanted to contribute, I am sure Jackson project would accept "Jackson 1.x annotations" module for github.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With