I'm using the latest version of Vert.x (4.3.2) and I wrote and handler for a route that serves a POST method.
Below my code to convert the JSON body of that method to a List of objects:
Class<List<CartLineItem>> cls = (Class<List<CartLineItem>>)(Object)List.class;
List<CartLineItem> itemsToAdd = rc.body().asPojo(cls);
Unforntunately whenever I try to iterate over itemsToAdd I get the exception: java.lang.ClassCastException: class java.util.LinkedHashMap cannot be cast to class com.acme.CartLineItem.
How can I fix this issue without using any other library except Vert.x (I mean .. using Jackson I would provide a TypeReference<List> object)?