forked from loafle/openapi-generator-original
[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:
@@ -123,11 +123,12 @@ class ApiClient
|
||||
* @param array $postData parameters to be placed in POST body
|
||||
* @param array $headerParams parameters to be place in request header
|
||||
* @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
|
||||
* @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();
|
||||
|
||||
@@ -266,8 +266,14 @@ use \{{invokerPackage}}\ObjectSerializer;
|
||||
'{{httpMethod}}',
|
||||
$queryParams,
|
||||
$httpBody,
|
||||
$headerParams{{#returnType}},
|
||||
'{{returnType}}'{{/returnType}}
|
||||
$headerParams,
|
||||
{{#returnType}}
|
||||
'{{returnType}}',
|
||||
{{/returnType}}
|
||||
{{^returnType}}
|
||||
null,
|
||||
{{/returnType}}
|
||||
'{{path}}'
|
||||
);
|
||||
|
||||
{{#returnType}}
|
||||
|
||||
Reference in New Issue
Block a user