[PHP] Add path without expanded path parameters to callApi

In continuation of #3117 it could be useful to know the path of an
endpoint (without path parameters expanded) in the `callApi` method of
`ApiClient`.

This is for use cases where you would create a derived class from
`ApiClient` for manipulating responses from the server before further
processing (#3117) or add extended logging of the API calls.
This commit is contained in:
Arne Jørgensen
2016-06-29 23:32:02 +02:00
parent 75bd838d23
commit 7d6ac31619
2 changed files with 10 additions and 3 deletions

View File

@@ -123,11 +123,12 @@ class ApiClient
* @param array $postData parameters to be placed in POST body * @param array $postData parameters to be placed in POST body
* @param array $headerParams parameters to be place in request header * @param array $headerParams parameters to be place in request header
* @param string $responseType expected response type of the endpoint * @param string $responseType expected response type of the endpoint
* @param string $endpointPath path to method endpoint before expanding parameters
* *
* @throws \{{invokerPackage}}\ApiException on a non 2xx response * @throws \{{invokerPackage}}\ApiException on a non 2xx response
* @return mixed * @return mixed
*/ */
public function callApi($resourcePath, $method, $queryParams, $postData, $headerParams, $responseType = null) public function callApi($resourcePath, $method, $queryParams, $postData, $headerParams, $responseType = null, $endpointPath = null)
{ {
$headers = array(); $headers = array();

View File

@@ -266,8 +266,14 @@ use \{{invokerPackage}}\ObjectSerializer;
'{{httpMethod}}', '{{httpMethod}}',
$queryParams, $queryParams,
$httpBody, $httpBody,
$headerParams{{#returnType}}, $headerParams,
'{{returnType}}'{{/returnType}} {{#returnType}}
'{{returnType}}',
{{/returnType}}
{{^returnType}}
null,
{{/returnType}}
'{{path}}'
); );
{{#returnType}} {{#returnType}}