Fix content type (#179)

* Update php client with OAS3

* Fix content type

the endpoint consumes 'application/x-www-form-urlencoded'

* Regenerate php client from OAS3

* Update the test case according to the fix on spec
This commit is contained in:
Akihito Nakano 2018-04-21 23:26:35 +09:00 committed by William Cheng
parent 72ffc95d6e
commit 5e05638360
19 changed files with 489 additions and 253 deletions

View File

@ -853,7 +853,7 @@ paths:
description: successful operation
requestBody:
content:
application/json:
application/x-www-form-urlencoded:
schema:
type: object
properties:

View File

@ -61,7 +61,7 @@ $apiInstance = new Swagger\Client\Api\AnotherFakeApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$client = new \Swagger\Client\Model\Client(); // Client | client model
$client = new \Swagger\Client\Model\Client(); // \Swagger\Client\Model\Client | client model
try {
$result = $apiInstance->testSpecialTags($client);
@ -121,7 +121,6 @@ Class | Method | HTTP request | Description
- [ArrayOfArrayOfNumberOnly](docs/Model/ArrayOfArrayOfNumberOnly.md)
- [ArrayOfNumberOnly](docs/Model/ArrayOfNumberOnly.md)
- [ArrayTest](docs/Model/ArrayTest.md)
- [Body4](docs/Model/Body4.md)
- [Capitalization](docs/Model/Capitalization.md)
- [Cat](docs/Model/Cat.md)
- [Category](docs/Model/Category.md)
@ -148,7 +147,7 @@ Class | Method | HTTP request | Description
- [OuterString](docs/Model/OuterString.md)
- [Pet](docs/Model/Pet.md)
- [ReadOnlyFirst](docs/Model/ReadOnlyFirst.md)
- [SpecialModelName_](docs/Model/SpecialModelName_.md)
- [SpecialModelName](docs/Model/SpecialModelName.md)
- [Tag](docs/Model/Tag.md)
- [User](docs/Model/User.md)

View File

@ -24,7 +24,7 @@ $apiInstance = new Swagger\Client\Api\AnotherFakeApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$client = new \Swagger\Client\Model\Client(); // Client | client model
$client = new \Swagger\Client\Model\Client(); // \Swagger\Client\Model\Client | client model
try {
$result = $apiInstance->testSpecialTags($client);
@ -39,7 +39,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**client** | [**Client**](../Model/Client.md)| client model |
**client** | [**\Swagger\Client\Model\Client**](../Model/Client.md)| client model |
### Return type

View File

@ -81,7 +81,7 @@ $apiInstance = new Swagger\Client\Api\FakeApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$outer_composite = new \Swagger\Client\Model\OuterComposite(); // OuterComposite | Input composite as post body
$outer_composite = new \Swagger\Client\Model\OuterComposite(); // \Swagger\Client\Model\OuterComposite | Input composite as post body
try {
$result = $apiInstance->fakeOuterCompositeSerialize($outer_composite);
@ -96,7 +96,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**outer_composite** | [**OuterComposite**](../Model/OuterComposite.md)| Input composite as post body | [optional]
**outer_composite** | [**\Swagger\Client\Model\OuterComposite**](../Model/OuterComposite.md)| Input composite as post body | [optional]
### Return type
@ -228,7 +228,7 @@ $apiInstance = new Swagger\Client\Api\FakeApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$client = new \Swagger\Client\Model\Client(); // Client | client model
$client = new \Swagger\Client\Model\Client(); // \Swagger\Client\Model\Client | client model
try {
$result = $apiInstance->testClientModel($client);
@ -243,7 +243,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**client** | [**Client**](../Model/Client.md)| client model |
**client** | [**\Swagger\Client\Model\Client**](../Model/Client.md)| client model |
### Return type
@ -359,11 +359,11 @@ $apiInstance = new Swagger\Client\Api\FakeApi(
new GuzzleHttp\Client()
);
$enum_header_string_array = array("enum_header_string_array_example"); // string[] | Header parameter enum test (string array)
$enum_header_string = "enum_header_string_example"; // string | Header parameter enum test (string)
$enum_header_string = "-efg"; // string | Header parameter enum test (string)
$enum_query_string_array = array("enum_query_string_array_example"); // string[] | Query parameter enum test (string array)
$enum_query_string = "enum_query_string_example"; // string | Query parameter enum test (string)
$enum_query_string = "-efg"; // string | Query parameter enum test (string)
$enum_query_integer = 56; // int | Query parameter enum test (double)
$enum_query_double = 1.2; // double | Query parameter enum test (double)
$enum_query_double = 3.4; // double | Query parameter enum test (double)
$enum_form_string_array = new \Swagger\Client\Model\array(); // string[] | Form parameter enum test (string array)
$enum_form_string = "enum_form_string_example"; // string | Form parameter enum test (string)
@ -380,9 +380,9 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**enum_header_string_array** | [**string[]**](../Model/string.md)| Header parameter enum test (string array) | [optional]
**enum_header_string** | **string**| Header parameter enum test (string) | [optional]
**enum_header_string** | **string**| Header parameter enum test (string) | [optional] [default to -efg]
**enum_query_string_array** | [**string[]**](../Model/string.md)| Query parameter enum test (string array) | [optional]
**enum_query_string** | **string**| Query parameter enum test (string) | [optional]
**enum_query_string** | **string**| Query parameter enum test (string) | [optional] [default to -efg]
**enum_query_integer** | **int**| Query parameter enum test (double) | [optional]
**enum_query_double** | **double**| Query parameter enum test (double) | [optional]
**enum_form_string_array** | [**string[]**](../Model/array.md)| Form parameter enum test (string array) | [optional]
@ -404,7 +404,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
# **testInlineAdditionalProperties**
> testInlineAdditionalProperties($unknown_base_type)
> testInlineAdditionalProperties($UNKNOWN_PARAM_NAME)
test inline additionalProperties
@ -418,10 +418,10 @@ $apiInstance = new Swagger\Client\Api\FakeApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$unknown_base_type = new \Swagger\Client\Model\UNKNOWN_BASE_TYPE(); // map[string,string] | request body
$UNKNOWN_PARAM_NAME = new \Swagger\Client\Model\null(); // | request body
try {
$apiInstance->testInlineAdditionalProperties($unknown_base_type);
$apiInstance->testInlineAdditionalProperties($UNKNOWN_PARAM_NAME);
} catch (Exception $e) {
echo 'Exception when calling FakeApi->testInlineAdditionalProperties: ', $e->getMessage(), PHP_EOL;
}
@ -432,7 +432,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**unknown_base_type** | [**map[string,string]**](../Model/UNKNOWN_BASE_TYPE.md)| request body |
**UNKNOWN_PARAM_NAME** | [****](../Model/.md)| request body |
### Return type
@ -450,7 +450,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
# **testJsonFormData**
> testJsonFormData($body4)
> testJsonFormData($param, $param2)
test json serialization of form data
@ -464,10 +464,11 @@ $apiInstance = new Swagger\Client\Api\FakeApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$body4 = new \Swagger\Client\Model\Body4(); // Body4 |
$param = "param_example"; // string | field1
$param2 = "param2_example"; // string | field2
try {
$apiInstance->testJsonFormData($body4);
$apiInstance->testJsonFormData($param, $param2);
} catch (Exception $e) {
echo 'Exception when calling FakeApi->testJsonFormData: ', $e->getMessage(), PHP_EOL;
}
@ -478,7 +479,8 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body4** | [**Body4**](../Model/Body4.md)| | [optional]
**param** | **string**| field1 |
**param2** | **string**| field2 |
### Return type
@ -490,7 +492,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

View File

@ -30,7 +30,7 @@ $apiInstance = new Swagger\Client\Api\FakeClassnameTags123Api(
new GuzzleHttp\Client(),
$config
);
$client = new \Swagger\Client\Model\Client(); // Client | client model
$client = new \Swagger\Client\Model\Client(); // \Swagger\Client\Model\Client | client model
try {
$result = $apiInstance->testClassname($client);
@ -45,7 +45,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**client** | [**Client**](../Model/Client.md)| client model |
**client** | [**\Swagger\Client\Model\Client**](../Model/Client.md)| client model |
### Return type

View File

@ -33,7 +33,7 @@ $apiInstance = new Swagger\Client\Api\PetApi(
new GuzzleHttp\Client(),
$config
);
$pet = new \Swagger\Client\Model\Pet(); // Pet | Pet object that needs to be added to the store
$pet = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet object that needs to be added to the store
try {
$apiInstance->addPet($pet);
@ -47,7 +47,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet** | [**Pet**](../Model/Pet.md)| Pet object that needs to be added to the store |
**pet** | [**\Swagger\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store |
### Return type
@ -83,7 +83,7 @@ $apiInstance = new Swagger\Client\Api\PetApi(
new GuzzleHttp\Client(),
$config
);
$pet_id = 789; // int | Pet id to delete
$pet_id = 56; // int | Pet id to delete
$api_key = "api_key_example"; // string |
try {
@ -245,7 +245,7 @@ $apiInstance = new Swagger\Client\Api\PetApi(
new GuzzleHttp\Client(),
$config
);
$pet_id = 789; // int | ID of pet to return
$pet_id = 56; // int | ID of pet to return
try {
$result = $apiInstance->getPetById($pet_id);
@ -296,7 +296,7 @@ $apiInstance = new Swagger\Client\Api\PetApi(
new GuzzleHttp\Client(),
$config
);
$pet = new \Swagger\Client\Model\Pet(); // Pet | Pet object that needs to be added to the store
$pet = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet object that needs to be added to the store
try {
$apiInstance->updatePet($pet);
@ -310,7 +310,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet** | [**Pet**](../Model/Pet.md)| Pet object that needs to be added to the store |
**pet** | [**\Swagger\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store |
### Return type
@ -346,7 +346,7 @@ $apiInstance = new Swagger\Client\Api\PetApi(
new GuzzleHttp\Client(),
$config
);
$pet_id = 789; // int | ID of pet that needs to be updated
$pet_id = 56; // int | ID of pet that needs to be updated
$name = "name_example"; // string | Updated name of the pet
$status = "status_example"; // string | Updated status of the pet
@ -400,7 +400,7 @@ $apiInstance = new Swagger\Client\Api\PetApi(
new GuzzleHttp\Client(),
$config
);
$pet_id = 789; // int | ID of pet to update
$pet_id = 56; // int | ID of pet to update
$additional_metadata = "additional_metadata_example"; // string | Additional data to pass to server
$file = "/path/to/file.txt"; // \SplFileObject | file to upload

View File

@ -126,7 +126,7 @@ $apiInstance = new Swagger\Client\Api\StoreApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$order_id = 789; // int | ID of pet that needs to be fetched
$order_id = 56; // int | ID of pet that needs to be fetched
try {
$result = $apiInstance->getOrderById($order_id);
@ -173,7 +173,7 @@ $apiInstance = new Swagger\Client\Api\StoreApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$order = new \Swagger\Client\Model\Order(); // Order | order placed for purchasing the pet
$order = new \Swagger\Client\Model\Order(); // \Swagger\Client\Model\Order | order placed for purchasing the pet
try {
$result = $apiInstance->placeOrder($order);
@ -188,7 +188,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**order** | [**Order**](../Model/Order.md)| order placed for purchasing the pet |
**order** | [**\Swagger\Client\Model\Order**](../Model/Order.md)| order placed for purchasing the pet |
### Return type

View File

@ -31,7 +31,7 @@ $apiInstance = new Swagger\Client\Api\UserApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$user = new \Swagger\Client\Model\User(); // User | Created user object
$user = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Created user object
try {
$apiInstance->createUser($user);
@ -45,7 +45,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**User**](../Model/User.md)| Created user object |
**user** | [**\Swagger\Client\Model\User**](../Model/User.md)| Created user object |
### Return type
@ -77,7 +77,7 @@ $apiInstance = new Swagger\Client\Api\UserApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$user = array(new \Swagger\Client\Model\User()); // \Swagger\Client\Model\User[] | List of user object
$user = array(new \Swagger\Client\Model\array()); // \Swagger\Client\Model\User[] | List of user object
try {
$apiInstance->createUsersWithArrayInput($user);
@ -91,7 +91,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**\Swagger\Client\Model\User[]**](../Model/User.md)| List of user object |
**user** | [**\Swagger\Client\Model\User[]**](../Model/array.md)| List of user object |
### Return type
@ -123,7 +123,7 @@ $apiInstance = new Swagger\Client\Api\UserApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$user = array(new \Swagger\Client\Model\User()); // \Swagger\Client\Model\User[] | List of user object
$user = array(new \Swagger\Client\Model\array()); // \Swagger\Client\Model\User[] | List of user object
try {
$apiInstance->createUsersWithListInput($user);
@ -137,7 +137,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**\Swagger\Client\Model\User[]**](../Model/User.md)| List of user object |
**user** | [**\Swagger\Client\Model\User[]**](../Model/array.md)| List of user object |
### Return type
@ -358,7 +358,7 @@ $apiInstance = new Swagger\Client\Api\UserApi(
new GuzzleHttp\Client()
);
$username = "username_example"; // string | name that need to be deleted
$user = new \Swagger\Client\Model\User(); // User | Updated user object
$user = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Updated user object
try {
$apiInstance->updateUser($username, $user);
@ -373,7 +373,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **string**| name that need to be deleted |
**user** | [**User**](../Model/User.md)| Updated user object |
**user** | [**\Swagger\Client\Model\User**](../Model/User.md)| Updated user object |
### Return type

View File

@ -0,0 +1,10 @@
# SpecialModelName
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**special_property_name** | **int** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -92,7 +92,7 @@ class AnotherFakeApi
*
* To test special tags
*
* @param Client $client client model (required)
* @param \Swagger\Client\Model\Client $client client model (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -109,7 +109,7 @@ class AnotherFakeApi
*
* To test special tags
*
* @param Client $client client model (required)
* @param \Swagger\Client\Model\Client $client client model (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -184,7 +184,7 @@ class AnotherFakeApi
*
* To test special tags
*
* @param Client $client client model (required)
* @param \Swagger\Client\Model\Client $client client model (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -204,7 +204,7 @@ class AnotherFakeApi
*
* To test special tags
*
* @param Client $client client model (required)
* @param \Swagger\Client\Model\Client $client client model (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -254,7 +254,7 @@ class AnotherFakeApi
/**
* Create request for operation 'testSpecialTags'
*
* @param Client $client client model (required)
* @param \Swagger\Client\Model\Client $client client model (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request

View File

@ -337,7 +337,7 @@ class FakeApi
/**
* Operation fakeOuterCompositeSerialize
*
* @param OuterComposite $outer_composite Input composite as post body (optional)
* @param \Swagger\Client\Model\OuterComposite $outer_composite Input composite as post body (optional)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -352,7 +352,7 @@ class FakeApi
/**
* Operation fakeOuterCompositeSerializeWithHttpInfo
*
* @param OuterComposite $outer_composite Input composite as post body (optional)
* @param \Swagger\Client\Model\OuterComposite $outer_composite Input composite as post body (optional)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -427,7 +427,7 @@ class FakeApi
*
*
*
* @param OuterComposite $outer_composite Input composite as post body (optional)
* @param \Swagger\Client\Model\OuterComposite $outer_composite Input composite as post body (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -447,7 +447,7 @@ class FakeApi
*
*
*
* @param OuterComposite $outer_composite Input composite as post body (optional)
* @param \Swagger\Client\Model\OuterComposite $outer_composite Input composite as post body (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -497,7 +497,7 @@ class FakeApi
/**
* Create request for operation 'fakeOuterCompositeSerialize'
*
* @param OuterComposite $outer_composite Input composite as post body (optional)
* @param \Swagger\Client\Model\OuterComposite $outer_composite Input composite as post body (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
@ -1080,7 +1080,7 @@ class FakeApi
*
* To test \"client\" model
*
* @param Client $client client model (required)
* @param \Swagger\Client\Model\Client $client client model (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -1097,7 +1097,7 @@ class FakeApi
*
* To test \"client\" model
*
* @param Client $client client model (required)
* @param \Swagger\Client\Model\Client $client client model (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -1172,7 +1172,7 @@ class FakeApi
*
* To test \"client\" model
*
* @param Client $client client model (required)
* @param \Swagger\Client\Model\Client $client client model (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -1192,7 +1192,7 @@ class FakeApi
*
* To test \"client\" model
*
* @param Client $client client model (required)
* @param \Swagger\Client\Model\Client $client client model (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -1242,7 +1242,7 @@ class FakeApi
/**
* Create request for operation 'testClientModel'
*
* @param Client $client client model (required)
* @param \Swagger\Client\Model\Client $client client model (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
@ -1738,9 +1738,9 @@ class FakeApi
* To test enum parameters
*
* @param string[] $enum_header_string_array Header parameter enum test (string array) (optional)
* @param string $enum_header_string Header parameter enum test (string) (optional)
* @param string $enum_header_string Header parameter enum test (string) (optional, default to -efg)
* @param string[] $enum_query_string_array Query parameter enum test (string array) (optional)
* @param string $enum_query_string Query parameter enum test (string) (optional)
* @param string $enum_query_string Query parameter enum test (string) (optional, default to -efg)
* @param int $enum_query_integer Query parameter enum test (double) (optional)
* @param double $enum_query_double Query parameter enum test (double) (optional)
* @param string[] $enum_form_string_array Form parameter enum test (string array) (optional)
@ -1750,7 +1750,7 @@ class FakeApi
* @throws \InvalidArgumentException
* @return void
*/
public function testEnumParameters($enum_header_string_array = null, $enum_header_string = null, $enum_query_string_array = null, $enum_query_string = null, $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = null, $enum_form_string = null)
public function testEnumParameters($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = null, $enum_form_string = null)
{
$this->testEnumParametersWithHttpInfo($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string);
}
@ -1761,9 +1761,9 @@ class FakeApi
* To test enum parameters
*
* @param string[] $enum_header_string_array Header parameter enum test (string array) (optional)
* @param string $enum_header_string Header parameter enum test (string) (optional)
* @param string $enum_header_string Header parameter enum test (string) (optional, default to -efg)
* @param string[] $enum_query_string_array Query parameter enum test (string array) (optional)
* @param string $enum_query_string Query parameter enum test (string) (optional)
* @param string $enum_query_string Query parameter enum test (string) (optional, default to -efg)
* @param int $enum_query_integer Query parameter enum test (double) (optional)
* @param double $enum_query_double Query parameter enum test (double) (optional)
* @param string[] $enum_form_string_array Form parameter enum test (string array) (optional)
@ -1773,7 +1773,7 @@ class FakeApi
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function testEnumParametersWithHttpInfo($enum_header_string_array = null, $enum_header_string = null, $enum_query_string_array = null, $enum_query_string = null, $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = null, $enum_form_string = null)
public function testEnumParametersWithHttpInfo($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = null, $enum_form_string = null)
{
$returnType = '';
$request = $this->testEnumParametersRequest($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string);
@ -1821,9 +1821,9 @@ class FakeApi
* To test enum parameters
*
* @param string[] $enum_header_string_array Header parameter enum test (string array) (optional)
* @param string $enum_header_string Header parameter enum test (string) (optional)
* @param string $enum_header_string Header parameter enum test (string) (optional, default to -efg)
* @param string[] $enum_query_string_array Query parameter enum test (string array) (optional)
* @param string $enum_query_string Query parameter enum test (string) (optional)
* @param string $enum_query_string Query parameter enum test (string) (optional, default to -efg)
* @param int $enum_query_integer Query parameter enum test (double) (optional)
* @param double $enum_query_double Query parameter enum test (double) (optional)
* @param string[] $enum_form_string_array Form parameter enum test (string array) (optional)
@ -1832,7 +1832,7 @@ class FakeApi
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function testEnumParametersAsync($enum_header_string_array = null, $enum_header_string = null, $enum_query_string_array = null, $enum_query_string = null, $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = null, $enum_form_string = null)
public function testEnumParametersAsync($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = null, $enum_form_string = null)
{
return $this->testEnumParametersAsyncWithHttpInfo($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string)
->then(
@ -1848,9 +1848,9 @@ class FakeApi
* To test enum parameters
*
* @param string[] $enum_header_string_array Header parameter enum test (string array) (optional)
* @param string $enum_header_string Header parameter enum test (string) (optional)
* @param string $enum_header_string Header parameter enum test (string) (optional, default to -efg)
* @param string[] $enum_query_string_array Query parameter enum test (string array) (optional)
* @param string $enum_query_string Query parameter enum test (string) (optional)
* @param string $enum_query_string Query parameter enum test (string) (optional, default to -efg)
* @param int $enum_query_integer Query parameter enum test (double) (optional)
* @param double $enum_query_double Query parameter enum test (double) (optional)
* @param string[] $enum_form_string_array Form parameter enum test (string array) (optional)
@ -1859,7 +1859,7 @@ class FakeApi
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function testEnumParametersAsyncWithHttpInfo($enum_header_string_array = null, $enum_header_string = null, $enum_query_string_array = null, $enum_query_string = null, $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = null, $enum_form_string = null)
public function testEnumParametersAsyncWithHttpInfo($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = null, $enum_form_string = null)
{
$returnType = '';
$request = $this->testEnumParametersRequest($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string);
@ -1891,9 +1891,9 @@ class FakeApi
* Create request for operation 'testEnumParameters'
*
* @param string[] $enum_header_string_array Header parameter enum test (string array) (optional)
* @param string $enum_header_string Header parameter enum test (string) (optional)
* @param string $enum_header_string Header parameter enum test (string) (optional, default to -efg)
* @param string[] $enum_query_string_array Query parameter enum test (string array) (optional)
* @param string $enum_query_string Query parameter enum test (string) (optional)
* @param string $enum_query_string Query parameter enum test (string) (optional, default to -efg)
* @param int $enum_query_integer Query parameter enum test (double) (optional)
* @param double $enum_query_double Query parameter enum test (double) (optional)
* @param string[] $enum_form_string_array Form parameter enum test (string array) (optional)
@ -1902,7 +1902,7 @@ class FakeApi
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
protected function testEnumParametersRequest($enum_header_string_array = null, $enum_header_string = null, $enum_query_string_array = null, $enum_query_string = null, $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = null, $enum_form_string = null)
protected function testEnumParametersRequest($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = null, $enum_form_string = null)
{
$resourcePath = '/fake';
@ -2021,15 +2021,15 @@ class FakeApi
*
* test inline additionalProperties
*
* @param map[string,string] $unknown_base_type request body (required)
* @param $UNKNOWN_PARAM_NAME request body (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function testInlineAdditionalProperties($unknown_base_type)
public function testInlineAdditionalProperties($UNKNOWN_PARAM_NAME)
{
$this->testInlineAdditionalPropertiesWithHttpInfo($unknown_base_type);
$this->testInlineAdditionalPropertiesWithHttpInfo($UNKNOWN_PARAM_NAME);
}
/**
@ -2037,16 +2037,16 @@ class FakeApi
*
* test inline additionalProperties
*
* @param map[string,string] $unknown_base_type request body (required)
* @param $UNKNOWN_PARAM_NAME request body (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function testInlineAdditionalPropertiesWithHttpInfo($unknown_base_type)
public function testInlineAdditionalPropertiesWithHttpInfo($UNKNOWN_PARAM_NAME)
{
$returnType = '';
$request = $this->testInlineAdditionalPropertiesRequest($unknown_base_type);
$request = $this->testInlineAdditionalPropertiesRequest($UNKNOWN_PARAM_NAME);
try {
$options = $this->createHttpClientOption();
@ -2090,14 +2090,14 @@ class FakeApi
*
* test inline additionalProperties
*
* @param map[string,string] $unknown_base_type request body (required)
* @param $UNKNOWN_PARAM_NAME request body (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function testInlineAdditionalPropertiesAsync($unknown_base_type)
public function testInlineAdditionalPropertiesAsync($UNKNOWN_PARAM_NAME)
{
return $this->testInlineAdditionalPropertiesAsyncWithHttpInfo($unknown_base_type)
return $this->testInlineAdditionalPropertiesAsyncWithHttpInfo($UNKNOWN_PARAM_NAME)
->then(
function ($response) {
return $response[0];
@ -2110,15 +2110,15 @@ class FakeApi
*
* test inline additionalProperties
*
* @param map[string,string] $unknown_base_type request body (required)
* @param $UNKNOWN_PARAM_NAME request body (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function testInlineAdditionalPropertiesAsyncWithHttpInfo($unknown_base_type)
public function testInlineAdditionalPropertiesAsyncWithHttpInfo($UNKNOWN_PARAM_NAME)
{
$returnType = '';
$request = $this->testInlineAdditionalPropertiesRequest($unknown_base_type);
$request = $this->testInlineAdditionalPropertiesRequest($UNKNOWN_PARAM_NAME);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@ -2146,17 +2146,17 @@ class FakeApi
/**
* Create request for operation 'testInlineAdditionalProperties'
*
* @param map[string,string] $unknown_base_type request body (required)
* @param $UNKNOWN_PARAM_NAME request body (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
protected function testInlineAdditionalPropertiesRequest($unknown_base_type)
protected function testInlineAdditionalPropertiesRequest($UNKNOWN_PARAM_NAME)
{
// verify the required parameter 'unknown_base_type' is set
if ($unknown_base_type === null || (is_array($unknown_base_type) && count($unknown_base_type) === 0)) {
// verify the required parameter 'UNKNOWN_PARAM_NAME' is set
if ($UNKNOWN_PARAM_NAME === null || (is_array($UNKNOWN_PARAM_NAME) && count($UNKNOWN_PARAM_NAME) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $unknown_base_type when calling testInlineAdditionalProperties'
'Missing the required parameter $UNKNOWN_PARAM_NAME when calling testInlineAdditionalProperties'
);
}
@ -2171,8 +2171,8 @@ class FakeApi
// body params
$_tempBody = null;
if (isset($unknown_base_type)) {
$_tempBody = $unknown_base_type;
if (isset($UNKNOWN_PARAM_NAME)) {
$_tempBody = $UNKNOWN_PARAM_NAME;
}
if ($multipart) {
@ -2241,15 +2241,16 @@ class FakeApi
*
* test json serialization of form data
*
* @param Body4 $body4 body4 (optional)
* @param string $param field1 (required)
* @param string $param2 field2 (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function testJsonFormData($body4 = null)
public function testJsonFormData($param, $param2)
{
$this->testJsonFormDataWithHttpInfo($body4);
$this->testJsonFormDataWithHttpInfo($param, $param2);
}
/**
@ -2257,16 +2258,17 @@ class FakeApi
*
* test json serialization of form data
*
* @param Body4 $body4 (optional)
* @param string $param field1 (required)
* @param string $param2 field2 (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function testJsonFormDataWithHttpInfo($body4 = null)
public function testJsonFormDataWithHttpInfo($param, $param2)
{
$returnType = '';
$request = $this->testJsonFormDataRequest($body4);
$request = $this->testJsonFormDataRequest($param, $param2);
try {
$options = $this->createHttpClientOption();
@ -2310,14 +2312,15 @@ class FakeApi
*
* test json serialization of form data
*
* @param Body4 $body4 (optional)
* @param string $param field1 (required)
* @param string $param2 field2 (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function testJsonFormDataAsync($body4 = null)
public function testJsonFormDataAsync($param, $param2)
{
return $this->testJsonFormDataAsyncWithHttpInfo($body4)
return $this->testJsonFormDataAsyncWithHttpInfo($param, $param2)
->then(
function ($response) {
return $response[0];
@ -2330,15 +2333,16 @@ class FakeApi
*
* test json serialization of form data
*
* @param Body4 $body4 (optional)
* @param string $param field1 (required)
* @param string $param2 field2 (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function testJsonFormDataAsyncWithHttpInfo($body4 = null)
public function testJsonFormDataAsyncWithHttpInfo($param, $param2)
{
$returnType = '';
$request = $this->testJsonFormDataRequest($body4);
$request = $this->testJsonFormDataRequest($param, $param2);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@ -2366,13 +2370,26 @@ class FakeApi
/**
* Create request for operation 'testJsonFormData'
*
* @param Body4 $body4 (optional)
* @param string $param field1 (required)
* @param string $param2 field2 (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
protected function testJsonFormDataRequest($body4 = null)
protected function testJsonFormDataRequest($param, $param2)
{
// verify the required parameter 'param' is set
if ($param === null || (is_array($param) && count($param) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $param when calling testJsonFormData'
);
}
// verify the required parameter 'param2' is set
if ($param2 === null || (is_array($param2) && count($param2) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $param2 when calling testJsonFormData'
);
}
$resourcePath = '/fake/jsonFormData';
$formParams = [];
@ -2383,11 +2400,16 @@ class FakeApi
// form params
if ($param !== null) {
$formParams['param'] = ObjectSerializer::toFormValue($param);
}
// form params
if ($param2 !== null) {
$formParams['param2'] = ObjectSerializer::toFormValue($param2);
}
// body params
$_tempBody = null;
if (isset($body4)) {
$_tempBody = $body4;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
@ -2396,7 +2418,7 @@ class FakeApi
} else {
$headers = $this->headerSelector->selectHeaders(
[],
['application/json']
['application/x-www-form-urlencoded']
);
}

View File

@ -92,7 +92,7 @@ class FakeClassnameTags123Api
*
* To test class name in snake case
*
* @param Client $client client model (required)
* @param \Swagger\Client\Model\Client $client client model (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -109,7 +109,7 @@ class FakeClassnameTags123Api
*
* To test class name in snake case
*
* @param Client $client client model (required)
* @param \Swagger\Client\Model\Client $client client model (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -184,7 +184,7 @@ class FakeClassnameTags123Api
*
* To test class name in snake case
*
* @param Client $client client model (required)
* @param \Swagger\Client\Model\Client $client client model (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -204,7 +204,7 @@ class FakeClassnameTags123Api
*
* To test class name in snake case
*
* @param Client $client client model (required)
* @param \Swagger\Client\Model\Client $client client model (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -254,7 +254,7 @@ class FakeClassnameTags123Api
/**
* Create request for operation 'testClassname'
*
* @param Client $client client model (required)
* @param \Swagger\Client\Model\Client $client client model (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request

View File

@ -92,7 +92,7 @@ class PetApi
*
* Add a new pet to the store
*
* @param Pet $pet Pet object that needs to be added to the store (required)
* @param \Swagger\Client\Model\Pet $pet Pet object that needs to be added to the store (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -108,7 +108,7 @@ class PetApi
*
* Add a new pet to the store
*
* @param Pet $pet Pet object that needs to be added to the store (required)
* @param \Swagger\Client\Model\Pet $pet Pet object that needs to be added to the store (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -161,7 +161,7 @@ class PetApi
*
* Add a new pet to the store
*
* @param Pet $pet Pet object that needs to be added to the store (required)
* @param \Swagger\Client\Model\Pet $pet Pet object that needs to be added to the store (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -181,7 +181,7 @@ class PetApi
*
* Add a new pet to the store
*
* @param Pet $pet Pet object that needs to be added to the store (required)
* @param \Swagger\Client\Model\Pet $pet Pet object that needs to be added to the store (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -217,7 +217,7 @@ class PetApi
/**
* Create request for operation 'addPet'
*
* @param Pet $pet Pet object that needs to be added to the store (required)
* @param \Swagger\Client\Model\Pet $pet Pet object that needs to be added to the store (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
@ -739,7 +739,7 @@ class PetApi
// query params
if (is_array($status)) {
$status = ObjectSerializer::serializeCollection($status, 'multi', true);
$status = ObjectSerializer::serializeCollection($status, 'csv', true);
}
if ($status !== null) {
$queryParams['status'] = ObjectSerializer::toQueryValue($status);
@ -1004,7 +1004,7 @@ class PetApi
// query params
if (is_array($tags)) {
$tags = ObjectSerializer::serializeCollection($tags, 'multi', true);
$tags = ObjectSerializer::serializeCollection($tags, 'csv', true);
}
if ($tags !== null) {
$queryParams['tags'] = ObjectSerializer::toQueryValue($tags);
@ -1351,7 +1351,7 @@ class PetApi
*
* Update an existing pet
*
* @param Pet $pet Pet object that needs to be added to the store (required)
* @param \Swagger\Client\Model\Pet $pet Pet object that needs to be added to the store (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -1367,7 +1367,7 @@ class PetApi
*
* Update an existing pet
*
* @param Pet $pet Pet object that needs to be added to the store (required)
* @param \Swagger\Client\Model\Pet $pet Pet object that needs to be added to the store (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -1420,7 +1420,7 @@ class PetApi
*
* Update an existing pet
*
* @param Pet $pet Pet object that needs to be added to the store (required)
* @param \Swagger\Client\Model\Pet $pet Pet object that needs to be added to the store (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -1440,7 +1440,7 @@ class PetApi
*
* Update an existing pet
*
* @param Pet $pet Pet object that needs to be added to the store (required)
* @param \Swagger\Client\Model\Pet $pet Pet object that needs to be added to the store (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -1476,7 +1476,7 @@ class PetApi
/**
* Create request for operation 'updatePet'
*
* @param Pet $pet Pet object that needs to be added to the store (required)
* @param \Swagger\Client\Model\Pet $pet Pet object that needs to be added to the store (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request

View File

@ -834,7 +834,7 @@ class StoreApi
*
* Place an order for a pet
*
* @param Order $order order placed for purchasing the pet (required)
* @param \Swagger\Client\Model\Order $order order placed for purchasing the pet (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -851,7 +851,7 @@ class StoreApi
*
* Place an order for a pet
*
* @param Order $order order placed for purchasing the pet (required)
* @param \Swagger\Client\Model\Order $order order placed for purchasing the pet (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -926,7 +926,7 @@ class StoreApi
*
* Place an order for a pet
*
* @param Order $order order placed for purchasing the pet (required)
* @param \Swagger\Client\Model\Order $order order placed for purchasing the pet (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -946,7 +946,7 @@ class StoreApi
*
* Place an order for a pet
*
* @param Order $order order placed for purchasing the pet (required)
* @param \Swagger\Client\Model\Order $order order placed for purchasing the pet (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -996,7 +996,7 @@ class StoreApi
/**
* Create request for operation 'placeOrder'
*
* @param Order $order order placed for purchasing the pet (required)
* @param \Swagger\Client\Model\Order $order order placed for purchasing the pet (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request

View File

@ -92,7 +92,7 @@ class UserApi
*
* Create user
*
* @param User $user Created user object (required)
* @param \Swagger\Client\Model\User $user Created user object (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -108,7 +108,7 @@ class UserApi
*
* Create user
*
* @param User $user Created user object (required)
* @param \Swagger\Client\Model\User $user Created user object (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -161,7 +161,7 @@ class UserApi
*
* Create user
*
* @param User $user Created user object (required)
* @param \Swagger\Client\Model\User $user Created user object (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -181,7 +181,7 @@ class UserApi
*
* Create user
*
* @param User $user Created user object (required)
* @param \Swagger\Client\Model\User $user Created user object (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -217,7 +217,7 @@ class UserApi
/**
* Create request for operation 'createUser'
*
* @param User $user Created user object (required)
* @param \Swagger\Client\Model\User $user Created user object (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
@ -1719,7 +1719,7 @@ class UserApi
* Updated user
*
* @param string $username name that need to be deleted (required)
* @param User $user Updated user object (required)
* @param \Swagger\Client\Model\User $user Updated user object (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -1736,7 +1736,7 @@ class UserApi
* Updated user
*
* @param string $username name that need to be deleted (required)
* @param User $user Updated user object (required)
* @param \Swagger\Client\Model\User $user Updated user object (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -1790,7 +1790,7 @@ class UserApi
* Updated user
*
* @param string $username name that need to be deleted (required)
* @param User $user Updated user object (required)
* @param \Swagger\Client\Model\User $user Updated user object (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -1811,7 +1811,7 @@ class UserApi
* Updated user
*
* @param string $username name that need to be deleted (required)
* @param User $user Updated user object (required)
* @param \Swagger\Client\Model\User $user Updated user object (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -1848,7 +1848,7 @@ class UserApi
* Create request for operation 'updateUser'
*
* @param string $username name that need to be deleted (required)
* @param User $user Updated user object (required)
* @param \Swagger\Client\Model\User $user Updated user object (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request

View File

@ -0,0 +1,302 @@
<?php
/**
* SpecialModelName
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.0-SNAPSHOT
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
use \ArrayAccess;
use \Swagger\Client\ObjectSerializer;
/**
* SpecialModelName Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class SpecialModelName implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = '_special_model.name_';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'special_property_name' => 'int'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'special_property_name' => 'int64'
];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'special_property_name' => '$special[property.name]'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'special_property_name' => 'setSpecialPropertyName'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'special_property_name' => 'getSpecialPropertyName'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['special_property_name'] = isset($data['special_property_name']) ? $data['special_property_name'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return true;
}
/**
* Gets special_property_name
*
* @return int
*/
public function getSpecialPropertyName()
{
return $this->container['special_property_name'];
}
/**
* Sets special_property_name
*
* @param int $special_property_name special_property_name
*
* @return $this
*/
public function setSpecialPropertyName($special_property_name)
{
$this->container['special_property_name'] = $special_property_name;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View File

@ -1,92 +0,0 @@
<?php
/**
* Body4Test
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.0-SNAPSHOT
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Please update the test case below to test the model.
*/
namespace Swagger\Client;
/**
* Body4Test Class Doc Comment
*
* @category Class
* @description Body4
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class Body4Test extends \PHPUnit_Framework_TestCase
{
/**
* Setup before running any test case
*/
public static function setUpBeforeClass()
{
}
/**
* Setup before running each test case
*/
public function setUp()
{
}
/**
* Clean up after running each test case
*/
public function tearDown()
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass()
{
}
/**
* Test "Body4"
*/
public function testBody4()
{
}
/**
* Test attribute "param"
*/
public function testPropertyParam()
{
}
/**
* Test attribute "param2"
*/
public function testPropertyParam2()
{
}
}

View File

@ -1,6 +1,6 @@
<?php
/**
* SpecialModelName_Test
* SpecialModelNameTest
*
* PHP version 5
*
@ -30,15 +30,15 @@
namespace Swagger\Client;
/**
* SpecialModelName_Test Class Doc Comment
* SpecialModelNameTest Class Doc Comment
*
* @category Class
* @description SpecialModelName_
* @description SpecialModelName
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class SpecialModelName_Test extends \PHPUnit_Framework_TestCase
class SpecialModelNameTest extends \PHPUnit_Framework_TestCase
{
/**
@ -70,9 +70,9 @@ class SpecialModelName_Test extends \PHPUnit_Framework_TestCase
}
/**
* Test "SpecialModelName_"
* Test "SpecialModelName"
*/
public function testSpecialModelName_()
public function testSpecialModelName()
{
}

View File

@ -22,22 +22,15 @@ class RequestTest extends \PHPUnit_Framework_TestCase
public function testFormDataEncodingToJson()
{
$this->api->testJsonFormData(
new Body4(['param' => 'value', 'param2' => 'value2'])
);
$this->api->testJsonFormData('value', 'value2');
$request = $this->fakeClient->getLastRequest();
$contentType = $request->getHeader('Content-Type');
$this->assertEquals(['application/json'], $contentType);
$this->assertEquals(['application/x-www-form-urlencoded'], $contentType);
$requestContent = $request->getBody()->getContents();
$expected = <<<__EOS__
{
"param": "value",
"param2": "value2"
}
__EOS__;
$this->assertEquals($expected, $requestContent);
// JSON serialization of form data is not supported
$this->assertEquals('param=value&param2=value2', $requestContent);
}
}