clear import mapping for gnereators that do not use it

This commit is contained in:
wing328
2016-07-26 14:40:29 +08:00
parent 30c2503f9f
commit 9489f7d3eb
47 changed files with 1948 additions and 46 deletions

View File

@@ -102,6 +102,88 @@ class FakeApi
return $this;
}
/**
* Operation testClientModel
*
* To test \"client\" model
*
* @param \Swagger\Client\Model\Client $body client model (required)
* @return \Swagger\Client\Model\Client
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function testClientModel($body)
{
list($response) = $this->testClientModelWithHttpInfo($body);
return $response;
}
/**
* Operation testClientModelWithHttpInfo
*
* To test \"client\" model
*
* @param \Swagger\Client\Model\Client $body client model (required)
* @return Array of \Swagger\Client\Model\Client, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function testClientModelWithHttpInfo($body)
{
// verify the required parameter 'body' is set
if ($body === null) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling testClientModel');
}
// parse inputs
$resourcePath = "/fake";
$httpBody = '';
$queryParams = array();
$headerParams = array();
$formParams = array();
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept;
}
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));
// default format to json
$resourcePath = str_replace("{format}", "json", $resourcePath);
// body params
$_tempBody = null;
if (isset($body)) {
$_tempBody = $body;
}
// for model (json/xml)
if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
} elseif (count($formParams) > 0) {
$httpBody = $formParams; // for HTTP post (form)
}
// make the API Call
try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath,
'PATCH',
$queryParams,
$httpBody,
$headerParams,
'\Swagger\Client\Model\Client',
'/fake'
);
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Client', $httpHeader), $statusCode, $httpHeader);
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Client', $e->getResponseHeaders());
$e->setResponseObject($data);
break;
}
throw $e;
}
}
/**
* Operation testEndpointParameters
*