A simple workaround for this is a custom bean processor like so:
public void processPersonSearchResponseJSON(Exchange exchange) throws
JsonParseException, JsonMappingException, IOException
{
ObjectMapper mapper = new ObjectMapper();
List<PersonSearchResponse> personSearchResponses =
mapper.readValue(exchange.getIn().getBody(String.class), new
TypeReference<List<PersonSearchResponse>>() { });
exchange.getIn().setBody(personSearchResponses);
}
and in the camel context:
<camel:to uri="JSONEndpoint"/>
<camel:convertBodyTo type="java.lang.String"/>
<camel:log message="This is the JSON Response: ${body}" />
<camel:to
uri="bean:personSearchResponseJSONProcessor?method=processPersonSearchResponseJSON"/>
--
View this message in context:
http://camel.465427.n5.nabble.com/JSON-Jackson-return-list-rather-than-POJO-tp5717341p5717347.html
Sent from the Camel - Users mailing list archive at Nabble.com.