jackson-databind supporting both 2.x & 3.x simultaneously? #313
-
|
If I'm building a library that wants to support jackson-databind both versions 2.x & 3.x, is that possible? I don't want my library to be prescriptive to a jackson version. For now, my library uses Could my library have a |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
@edeandrea Yes, in the sense that 2.x and 3.x live in different namespaces (Java packages: But I guess what exactly do you mean supporting both. For value classes that just use annotations from |
Beta Was this translation helpful? Give feedback.
-
|
Yes. It is possible to have optional or provided dependencies on both Jackson 2 and Jackson 3 libs because they use different package names. |
Beta Was this translation helpful? Give feedback.
@edeandrea Yes, in the sense that 2.x and 3.x live in different namespaces (Java packages:
com.fasterxml.jacksonfor 2.x vstools.jacksonfor 3.x). And both use 2.x annotations.But I guess what exactly do you mean supporting both.
For value classes that just use annotations from
jackson-annotations(2.20) this is easy; both 2.x and 3.x support same set. But otherwise code needs to use one or the other.