Configure Jersey/Jackson to NOT use @XmlElement field annotation for JSON field naming

前端 未结 1 1959
暗喜
暗喜 2020-12-03 00:05

I am running a Jersey REST service. The POJO\'s which represent my resources are JAXB (XML) annotated simple Java classes (they are generated from a schema definition - so t

相关标签:
1条回答
  • 2020-12-03 00:45

    At low level, what is needed to make sure that ObjectMapper does NOT use JAXBAnnotationIntrospector, but only default JacksonAnnotationIntrospector. I think you should be able to just construct ObjectMapper (which does not add JAXB introspector by default), and register it via standard JAX-RS provider mechanism. This should override ObjectMapper that POJO mapper functionality would otherwise construct.

    0 讨论(0)
提交回复
热议问题