I have a java bean that uses the JAXB annotation: @XmlRootElement(name="beanName")
. Is there a way to configure jackson to use the name
property of the @XmlRootElement
annotation when deserializing?
One thing I've done to make sure that Jackson uses the @XMLRootElement of a class is to set the provider class to be JacksonJaxbJsonProvider
(rather than, e.g. JacksonJsonProvider
). This can be done in a number of ways, depending on what JAX-RS implementation you are using, and whether the code is client side or server side.
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