[ 
https://issues.apache.org/jira/browse/CAMEL-7858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14146096#comment-14146096
 ] 

Willem Jiang commented on CAMEL-7858:
-------------------------------------

Hi Nicolás, 

I just apply a patch into master branch.

You can override the default setting by apply the your ObjectMapper when create 
the JacksonDataFormat.
Just like this 
{code}
JacksonDataFormat formatPojo = new JacksonDataFormat(new ObjectMapper(), 
TestJAXBPojo.class);
{code}

> Allow to disable Jaxb annotations in JacksonDataFormat
> ------------------------------------------------------
>
>                 Key: CAMEL-7858
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7858
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-jackson
>    Affects Versions: 2.14.0
>            Reporter: Nicolás Amador
>            Assignee: Willem Jiang
>            Priority: Minor
>             Fix For: 2.15.0
>
>
> The existing code of camel jackson dataformat does not support that we 
> disable the JaxbAnnotationModule() 
> {code}
> public JacksonDataFormat(Class<?> unmarshalType, Class<?> jsonView) { 
>         this.objectMapper = new ObjectMapper(); 
>         this.unmarshalType = unmarshalType; 
>         this.jsonView = jsonView; 
>         // Enables JAXB processing 
>         JaxbAnnotationModule module = new JaxbAnnotationModule(); 
>         this.objectMapper.registerModule(module); 
>     } 
> {code}
> If we have an attribute like this: 
> {code}
> @XmlAttribute(name = "has-children", required = true) 
> private Boolean hasChildren; 
> {code}
> In previous version (2.9.7 for instance): 
> {code}
> XML: "has-children" 
> Json: "hasChildren" 
> {code}
> In the current one (2.14.0): 
> {code}
> XML: "has-children" 
> Json: "has-children" 
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to