From 5c79c21f3cdc7cd26a80645ea1f5efaaec3d3287 Mon Sep 17 00:00:00 2001 From: Shyri Villar Date: Thu, 5 Nov 2015 07:40:19 +0100 Subject: [PATCH] fixed Api returnType [android-volley] --- .../src/main/resources/android-volley/api.mustache | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/android-volley/api.mustache b/modules/swagger-codegen/src/main/resources/android-volley/api.mustache index b255bbc459..87e41695df 100644 --- a/modules/swagger-codegen/src/main/resources/android-volley/api.mustache +++ b/modules/swagger-codegen/src/main/resources/android-volley/api.mustache @@ -1,6 +1,6 @@ package {{package}}; -import {{invokerPackage}}.ApiException; +import {{invokerPackage}}.Responses; import {{invokerPackage}}.ApiInvoker; import {{invokerPackage}}.Pair; @@ -46,7 +46,7 @@ public class {{classname}} { {{#allParams}} * @param {{paramName}} {{description}} {{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} */ - public void {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}, final {{#returnBaseType}}{{returnBaseType}}Responses.{{#returnContainer}}{{returnContainer}}{{/returnContainer}}{{returnBaseType}}Response{{/returnBaseType}}{{^returnBaseType}}Response.Listener{{/returnBaseType}} responseListener) { + public void {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}, final {{#returnBaseType}}Responses.{{returnBaseType}}{{#isListContainer}}List{{/isListContainer}}Response{{/returnBaseType}}{{^returnBaseType}}Response.Listener{{/returnBaseType}} responseListener) { Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set @@ -105,7 +105,7 @@ public class {{classname}} { @Override public void onResponse(String response) { try { - responseListener.onResponse((List) ApiInvoker.deserialize(response, "array", Phone.class)); + responseListener.onResponse({{returnType}}) ApiInvoker.deserialize(response, "array", Phone.class)); } catch (ApiException exception) { //TODO onError Log.d("ERROR", "error");