Fixed bug that did not allow json arrays to be deserialized by Jackson

This commit is contained in:
gandrianakis 2015-02-17 15:17:32 +02:00
parent 97fca910a1
commit 5fa98b12b8

View File

@ -51,8 +51,11 @@ public class ApiInvoker {
}
public static Object deserialize(String json, String containerType, Class cls) throws ApiException {
if(null != containerType) {
containerType = containerType.toLowerCase();
}
try{
if("List".equals(containerType)) {
if("list".equals(containerType) || "array".equals(containerType)) {
JavaType typeInfo = JsonUtil.getJsonMapper().getTypeFactory().constructCollectionType(List.class, cls);
List response = (List<?>) JsonUtil.getJsonMapper().readValue(json, typeInfo);
return response;