use baseName for parameter name in PHP api

This commit is contained in:
William Cheng 2015-03-09 23:15:12 +08:00
parent dc5ee9dcf5
commit 7c23eedf07

View File

@ -50,20 +50,20 @@ class {{classname}} {
{{#queryParams}}// query params
if(${{paramName}} !== null) {
$queryParams['{{paramName}}'] = $this->apiClient->toQueryValue(${{paramName}});
$queryParams['{{baseName}}'] = $this->apiClient->toQueryValue(${{paramName}});
}{{/queryParams}}
{{#headerParams}}// header params
if(${{paramName}} !== null) {
$headerParams['{{paramName}}'] = $this->apiClient->toHeaderValue(${{paramName}});
$headerParams['{{baseName}}'] = $this->apiClient->toHeaderValue(${{paramName}});
}{{/headerParams}}
{{#pathParams}}// path params
if(${{paramName}} !== null) {
$resourcePath = str_replace("{" . "{{paramName}}" . "}",
$resourcePath = str_replace("{" . "{{baseName}}" . "}",
$this->apiClient->toPathValue(${{paramName}}), $resourcePath);
}{{/pathParams}}
{{#formParams}}
if (${{paramName}} !== null) {
$formParams[{{paramName}}] = {{#isFile}}'@' . {{/isFile}}${{paramName}};
$formParams[{{baseName}}] = {{#isFile}}'@' . {{/isFile}}${{paramName}};
}{{/formParams}}
{{#bodyParams}}// body params
$body = null;