[ 
https://issues.apache.org/jira/browse/CAMEL-26981?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Federico Mariani reassigned CAMEL-26981:
----------------------------------------

    Assignee: Federico Mariani

> camel-main: camel.dataformat.* options are not applied to the data formats of 
> the REST DSL binding
> --------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-26981
>                 URL: https://issues.apache.org/jira/browse/CAMEL-26981
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-main, rest
>    Affects Versions: 4.18.5, 4.22.2, 4.23.0
>            Reporter: Federico Mariani
>            Assignee: Federico Mariani
>            Priority: Minor
>             Fix For: 4.24.0
>
>
> With Camel Main (and Camel JBang), the {{camel.dataformat.<name>.*}} options 
> configure the data format that {{marshal().json()}} uses, but not the data 
> formats that the REST DSL binding creates for {{json}} and {{xml}} binding: 
> RestBindingAdviceFactory creates new instances and applies only 
> {{camel.rest.data-format-properties}} to them.
> {code:java}
> // application.properties: camel.dataformat.jackson.include = NON_NULL
> restConfiguration().bindingMode(RestBindingMode.json);
> rest("/pojo").get().outType(MyPojo.class).to("direct:pojo"); // returns 
> MyPojo with name = "a" and nick = null
> {code}
> The response is {{\{"name":"a","nick":null\}}}, while {{marshal().json()}} of 
> the same POJO gives {{\{"name":"a"\}}}. The request side is the same (e.g. 
> {{camel.dataformat.jackson.disable-features}}).
> Expected: the REST binding data formats start from the options of the 
> configured data format, as route data formats do since CAMEL-22352, and 
> {{camel.rest.data-format-properties}} still take precedence.
> _Claude Code on behalf of Federico Mariani_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to