From 5fa98b12b85b4eada46b18a06ae9d93c6ce290fc Mon Sep 17 00:00:00 2001 From: gandrianakis Date: Tue, 17 Feb 2015 15:17:32 +0200 Subject: [PATCH] Fixed bug that did not allow json arrays to be deserialized by Jackson --- .../src/main/resources/Java/apiInvoker.mustache | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/apiInvoker.mustache b/modules/swagger-codegen/src/main/resources/Java/apiInvoker.mustache index 881cab13e12..26379c60105 100644 --- a/modules/swagger-codegen/src/main/resources/Java/apiInvoker.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/apiInvoker.mustache @@ -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;