diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index 1267f76d358..a434699f90a 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -73,14 +73,14 @@ class {{classname}} { $formParams['{{baseName}}'] = {{#isFile}}'@' . {{/isFile}}$this->apiClient->toFormValue(${{paramName}}); }{{/formParams}} {{#bodyParams}}// body params - $body = null; + $_tempBody = null; if (isset(${{paramName}})) { - $body = ${{paramName}}; + $_tempBody = ${{paramName}}; }{{/bodyParams}} // for model (json/xml) - if (isset($body)) { - $httpBody = $body; // $body is the method argument, if present + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present } // for HTTP post (form)