Skip to content

Commit 7d6ac31

Browse files
committed
[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.
1 parent 75bd838 commit 7d6ac31

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

modules/swagger-codegen/src/main/resources/php/ApiClient.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,12 @@ class ApiClient
123123
* @param array $postData parameters to be placed in POST body
124124
* @param array $headerParams parameters to be place in request header
125125
* @param string $responseType expected response type of the endpoint
126+
* @param string $endpointPath path to method endpoint before expanding parameters
126127
*
127128
* @throws \{{invokerPackage}}\ApiException on a non 2xx response
128129
* @return mixed
129130
*/
130-
public function callApi($resourcePath, $method, $queryParams, $postData, $headerParams, $responseType = null)
131+
public function callApi($resourcePath, $method, $queryParams, $postData, $headerParams, $responseType = null, $endpointPath = null)
131132
{
132133
133134
$headers = array();

modules/swagger-codegen/src/main/resources/php/api.mustache

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,14 @@ use \{{invokerPackage}}\ObjectSerializer;
266266
'{{httpMethod}}',
267267
$queryParams,
268268
$httpBody,
269-
$headerParams{{#returnType}},
270-
'{{returnType}}'{{/returnType}}
269+
$headerParams,
270+
{{#returnType}}
271+
'{{returnType}}',
272+
{{/returnType}}
273+
{{^returnType}}
274+
null,
275+
{{/returnType}}
276+
'{{path}}'
271277
);
272278

273279
{{#returnType}}

0 commit comments

Comments
 (0)