I'd like to know how to unmarshal JSON string body to List of MyClass. The following sample doesn't work well.
from("direct:testroute")
.log("Received body ${body}")
.unmarshal().json(JsonLibrary.Jackson, List.class)
And I'd like to have something like (obviously doesn't work too)
from("direct:testroute")
.log("Received body ${body}")
.unmarshal().json(JsonLibrary.Jackson, List<MyClass>.class)
Create
JacksonDataFormat format = new ListJacksonDataFormat(MyClass.class);
and then:
//...
.unmarshal(format)
//...
source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With