Skip to content

Commit 8db58df

Browse files
committed
Correct array return type formatting
1 parent c481186 commit 8db58df

2 files changed

Lines changed: 224 additions & 164 deletions

File tree

resources/templates/api.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class {{classname}} extends BaseApi
7474
public function {{operationId}}({{#if vendorExtensions.x-group-parameters}}array $associative_array{{else}}{{#each allParams}}
7575
{{#unless required}}?{{/unless}}{{dataType}} ${{paramName}}{{#unless required}} = {{#if defaultValue}}{{{defaultValue}}}{{else}}null{{/if}}{{/unless}}{{#unless @last}},{{/unless}}
7676
{{/each}}
77-
{{~/if}}): {{#if returnType}}{{#if responses.0.dataType}}{{responses.0.dataType}}{{else}}void{{/if}}{{else}}void{{/if}} {
77+
{{~/if}}): {{#if returnType}}{{#if responses.0.dataType}}{{#if responses.0.isArray}}array{{else}}{{responses.0.dataType}}{{/if}}{{else}}void{{/if}}{{else}}void{{/if}} {
7878
{{#if returnType}}return {{/if}}$this->{{operationId}}WithHttpInfo({{#if vendorExtensions.x-group-parameters}}$associative_array{{else}}{{#allParams}}${{paramName}}{{#unless @last}}, {{/unless}}{{/allParams}}{{/if}});
7979
}
8080

@@ -108,7 +108,7 @@ class {{classname}} extends BaseApi
108108
protected function {{operationId}}WithHttpInfo({{#if vendorExtensions.x-group-parameters}}
109109
array $associative_array{{else}}{{#each allParams}}
110110
{{#unless required}}?{{/unless}}{{dataType}} ${{paramName}}{{#unless required}} = {{#if defaultValue}}{{{defaultValue}}}{{else}}null{{/if}}{{/unless}},
111-
{{/each}}{{/if}}): {{#if returnType}}{{#if responses.0.dataType}}{{responses.0.dataType}}{{else}}void{{/if}}{{else}}void{{/if}} {
111+
{{/each}}{{/if}}): {{#if returnType}}{{#if responses.0.dataType}}{{#if responses.0.isArray}}array{{else}}{{responses.0.dataType}}{{/if}}{{else}}void{{/if}}{{else}}void{{/if}} {
112112
$request = $this->{{operationId}}Request({{#if vendorExtensions.x-group-parameters}}$associative_array{{else}}{{#allParams}}${{paramName}}{{#unless @last}}, {{/unless}}{{/allParams}}{{/if}});
113113
$this->writeDebug($request);
114114
$this->writeDebug((string) $request->getBody());

0 commit comments

Comments
 (0)