You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Tim Dudgeon <td...@gmail.com> on 2016/05/30 18:42:29 UTC

regression with REST DSL PUT operations using auto binding?

I think I've hit a regression in 2.17.1 (worked in 2.16.2) with PUT 
operations with REST DSL.

When the input contains a body (and only if it does, and only with PUT) 
the auto binding of the output does not seem to work. Something like:

.put("/some/path").description("Update something")
.bindingMode(RestBindingMode.json).consumes("application/json").produces("application/json")
     .type(Apple.class).outType(Pear.class)
     .route()
     .process((Exchange exch) -> {
         Apple apple = exch.getIn().getBody(Apple.class);
         Pear pear = convert(apple)
         exch.getIn().setBody(pear); // no longer gets converted to json
     })
     .endRest()

If I turn off automatic binding and do it myself its all OK.

Any thoughts?

Tim