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

Claus Ibsen commented on CAMEL-7880:
------------------------------------

You can configure data formats, using the dataFormatProperty in XML also

For example
{code}
  <restConfiguration component="servlet" bindingMode="json" 
contextPath="/camel-example-servlet-rest-blueprint/rest"
                       port="8181">
      <dataFormatProperty key="prettyPrint" value="true"/>
    </restConfiguration>
{code}

You can have as many dataFormatProperty you want. And you can prefix with 
json.in xml.in etc, as in the documentation to have different config.

The rest-dsl requires to instantiate and handle the lifecycle of the used data 
format, hence not intended to use an existing instance.

> Cannot use custom DataFormats in REST DSL
> -----------------------------------------
>
>                 Key: CAMEL-7880
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7880
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.14.0
>            Reporter: Sohrab Hosseini
>            Assignee: Claus Ibsen
>             Fix For: 2.14.1, 2.15.0
>
>         Attachments: camel-rest-dataformat-test.groovy
>
>
> See: 
> http://camel.465427.n5.nabble.com/RestBindingProcessor-JSON-Data-Format-Config-td5757103.html
> When using custom JSON data format in REST DSL, the service incorrectly 
> rejects messages with request structure and accepts messages with response 
> structure.
> This is due to 
> {{org.apache.camel.model.rest.RestBindingDefinition.createProcessor(RouteContext)}}
>  looking up and configuring the same DataFormat object twice:
> {code:java}
> DataFormat json = context.resolveDataFormat(name); 
> DataFormat outJson = context.resolveDataFormat(name); 
> {code}



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

Reply via email to