Skip to content

Commit

Permalink
[BUG][PHP] Parameter property style not fully implemented (related to…
Browse files Browse the repository at this point in the history
… comment on PR OpenAPITools#3984)
  • Loading branch information
thomasphansen committed Mar 4, 2020
1 parent 3e5fb67 commit b786fe3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions modules/openapi-generator/src/main/resources/php/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,22 @@ use {{invokerPackage}}\ObjectSerializer;
$multipart = false;

{{#queryParams}}

// query params
{{#isExplode}}
if (${{paramName}} !== null) {
{{#style}}
if('form' === '{{style}}' && is_array(${{paramName}})) {
foreach(${{paramName}} as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['{{baseName}}'] = ${{paramName}};
}
{{/style}}
{{^style}}
$queryParams['{{baseName}}'] = ${{paramName}};
{{/style}}
}
{{/isExplode}}
{{^isExplode}}
Expand All @@ -487,7 +498,6 @@ use {{invokerPackage}}\ObjectSerializer;
$queryParams['{{baseName}}'] = ${{paramName}};
}
{{/isExplode}}

{{/queryParams}}

{{#headerParams}}
Expand Down

0 comments on commit b786fe3

Please sign in to comment.