I am trying to use a service that gives me an object with a field that is an array.
{ "id": "23233", "items": [ { "name": "item 1" }, { "name": "item 2" } ] }
But when an array contains one element, the element itself is returned, not an array of one element.
{ "id": "43567", "items": { "name": "item only" } }
In this case, Jackson cannot convert my Java object.
public class ResponseItem { private String id; private List<Item> items;
Is there a direct solution for this?
source share