Вы можете создать один ObjectMapper, который расширяет Codehaus как -
public class JaxbJacksonObjectMapper extends ObjectMapper {
public JaxbJacksonObjectMapper() {
final AnnotationIntrospector introspector = new JaxbAnnotationIntrospector();
this.configure(org.codehaus.jackson.map.DeserializationConfig.Feature.UNWRAP_ROOT_VALUE, true);
super.getDeserializationConfig().withAnnotationIntrospector(introspector);
this.configure(org.codehaus.jackson.map.SerializationConfig.Feature.WRAP_ROOT_VALUE, true);
super.getSerializationConfig().withAnnotationIntrospector(introspector);
}
}
Я предполагаю, что вы не используете Spring Boot. Помогает ли это? http://stackoverflow.com/questions/4823358/spring-configure-responsebody-json-format –