mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 11:23:58 +00:00
fixed Api returnType [android-volley]
This commit is contained in:
parent
c3679893df
commit
5c79c21f3c
@ -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<String>{{/returnBaseType}} responseListener) {
|
||||
public void {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}, final {{#returnBaseType}}Responses.{{returnBaseType}}{{#isListContainer}}List{{/isListContainer}}Response{{/returnBaseType}}{{^returnBaseType}}Response.Listener<String>{{/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<Phone>) ApiInvoker.deserialize(response, "array", Phone.class));
|
||||
responseListener.onResponse({{returnType}}) ApiInvoker.deserialize(response, "array", Phone.class));
|
||||
} catch (ApiException exception) {
|
||||
//TODO onError
|
||||
Log.d("ERROR", "error");
|
||||
|
Loading…
Reference in New Issue
Block a user