Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[BUG][PHP] Parameter property style not fully implemented (related to…
… comment on PR #3984)
  • Loading branch information
thomasphansen committed Mar 4, 2020
commit b786fe3a9a84461e76c412ed0a3a7c472362e35c
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}})) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may submit a PR later to add a space after if and put line 484 in the same line as line 483, i.e. } else {

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