mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 03:18:53 +00:00
revert petstore json, fixed test case
This commit is contained in:
parent
2258a4632d
commit
38149173ff
@ -235,7 +235,7 @@
|
||||
"200": {
|
||||
"description": "successful operation",
|
||||
"schema": {
|
||||
"type": "file"
|
||||
"$ref": "#/definitions/Pet"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
|
@ -329,7 +329,7 @@ class PetApi {
|
||||
* Find pet by ID
|
||||
*
|
||||
* @param int $pet_id ID of pet that needs to be fetched (required)
|
||||
* @return \SplFileObject
|
||||
* @return \Swagger\Client\Model\Pet
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function getPetById($pet_id) {
|
||||
@ -387,11 +387,11 @@ class PetApi {
|
||||
try {
|
||||
list($response, $httpHeader) = $this->apiClient->callApi($resourcePath, $method,
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, '\SplFileObject');
|
||||
$headerParams, '\Swagger\Client\Model\Pet');
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SplFileObject', $httpHeader);
|
||||
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet', $httpHeader);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
}
|
||||
@ -403,7 +403,7 @@ class PetApi {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->apiClient->getSerializer()->deserialize($response,'\SplFileObject');
|
||||
return $this->apiClient->getSerializer()->deserialize($response,'\Swagger\Client\Model\Pet');
|
||||
|
||||
}
|
||||
|
||||
|
@ -70,9 +70,11 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse(isset($defaultHeader['test2']));
|
||||
|
||||
$pet_api2 = new Swagger\Client\Api\PetAPI();
|
||||
$apiClient3 = new Swagger\Client\ApiClient();
|
||||
$config3 = new Swagger\Client\Configuration();
|
||||
$apiClient3 = new Swagger\Client\ApiClient($config3);
|
||||
$apiClient3->getConfig()->setUserAgent('api client 3');
|
||||
$apiClient4 = new Swagger\Client\ApiClient();
|
||||
$config4 = new Swagger\Client\Configuration();
|
||||
$apiClient4 = new Swagger\Client\ApiClient($config4);
|
||||
$apiClient4->getConfig()->setUserAgent('api client 4');
|
||||
$pet_api3 = new Swagger\Client\Api\PetAPI($apiClient3);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user