I logged a ticket https://issues.apache.org/jira/browse/CAMEL-8528
And as Sergey also says we can with all the information from the rest-dsl uses that as fallback to set the CT header, so Gregors example also would work. This makes rest-dsl simpler to use, and for use-cases where you just do a get -> to, and setup the consumes/producers information. On Thu, Sep 3, 2015 at 5:19 PM, Claus Ibsen <[email protected]> wrote: > Hi > > That was designed for documentation purpose only (and as a hint to > Camel whether its json or xml data), so what you define in > produces/consumers/description etc is for documentation, and the > swagger-api etc. > > I assume when you have binding mode enabled then the library that does > the binding sets the content-type header. And thus why you see the > value. > > Though we could consider letting Camel use producers as a fallback if > it hasn't been set, even when you have binding mode turned off? > > > > On Fri, Aug 21, 2015 at 10:55 AM, Gregor Zurowski <[email protected]> wrote: >> Hi everyone: >> >> When I set up the following simple route with Camel 2.15.2 and Rest >> DSL, the response will not contain the media type as specified by the >> 'produces' verb: >> >> rest("/hello") >> .produces("application/json") >> .get("/{name}").to("direct:hello"); >> >> from("direct:hello").transform(simple("{ ${header.name} }")); >> >> The correct media type is returned when an object is returned by the >> route and binding mode is set to JSON. If a string is returned as >> above, and binding is disabled, no media type is set. I am wondering >> if this is intentional or whether I am missing something? >> >> Thanks in advance, >> Gregor > > > > -- > Claus Ibsen > ----------------- > http://davsclaus.com @davsclaus > Camel in Action 2nd edition: http://www.manning.com/ibsen2 -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2nd edition: https://www.manning.com/books/camel-in-action-second-edition
