Jackson unable to consider @XmlElement while serializing to JSON

前端 未结 2 1115
闹比i
闹比i 2020-12-19 20:47

I have a contract class that contains elements with @XmlElement tags. For ex

 @XmlElement(name = \"balancemoney\")
 protected Amount balanceMoney;

2条回答
  •  长情又很酷
    2020-12-19 21:23

    According to Using JAXB annotations with Jackson: Enabling JAXB annotation support, you need to set mapper.getDeserializationConfig().setAnnotationIntrospector(new JaxbAnnotationIntrospector()); to enable Jackson to use JAXB annotation.

提交回复
热议问题