I am trying to use apache-camel, and I set up a base route that calls the HTTP service through the http4 component, converts the result through unmarshal (). json (JsonLibrary.Jackson) and then prints part of the response in the bean.
The problem I am facing is that it explodes at runtime when it gets into json unmarhsaller:
There is no type converter available for conversion from type: java.util.HashMap to the required type: com.xxx.MyType
The answer has the following format:
{"data":[{"x":"y"},{"x":"z"}]}
And my object model is similar:
@lombok.Data class Response { private List<Elem> data; } @lombok.Data class Elem { private String x; }
Thus, it would seem that unmarshaller believes that the response is a hash map, whereas I want it to be marked in the structure of the object. Is there a way to get him to do what I want?
Kevin
source share