Hi
You need to set the type as SpeakerPojo.class
I don't see a spring example here setting type but it should work the same as 
java so adjust accordingly.
http://camel.apache.org/rest-dsl.html

Taariq

> On 26 Nov 2014, at 17:40, Vaïsse-Lesteven Arthur <arthurvai...@yahoo.fr> 
> wrote:
> 
> Hi every one!
> 
> I'm trying to create a RESTful API using the Rest DSL capacity of the
> release 2.14.0 of Camel.
> 
> My problem currently come from the fact that the body of the Exchange is
> automatically casted into a java Map object.
> 
> Here come a reduced example (I tried to make it as small as possible...) : 
> 
> This is my XML camel context file. It defines a rest API that accept
> conection on http://localhost:5117/rest/speakers/{speaker_id} and that
> expect HTTP put with a Json object that is serializable into a SpeakerPojo
> object.
> 
> 
> The java classes that backed this endpoint are:
> The SpeakerPojo object:
> 
> And the bean used as endpoint :
> 
> 
> Finally I use this code to call the restAPI :
> 
> 
> These call make the following error to occur:
> 
> 
> The message body have automatically transformed into a HashMap. So I tried
> to add before the unmarshaller call 
> I then got this :
> 
> And a parsing error as double quote are now absent due to the double
> conversion from string to map and from map to string.
> 
> Am I doing something wrong ? Can I dis-activate the auto-casting of the
> payload to HashMap ?
> 
> Thank in advance!
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Rest-DSL-Automatic-convertion-of-body-to-java-util-Map-How-to-fix-it-tp5759648.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to