Merge pull request #7 from ackintosh/fix-missing-requestbody-param

Fix missing requestBody param
This commit is contained in:
William Cheng 2018-04-01 00:58:31 +08:00 committed by GitHub
commit f0497e249d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 358 additions and 57 deletions

View File

@ -3929,6 +3929,11 @@ public class DefaultCodegen implements CodegenConfig {
List<CodegenParameter> parameters = new ArrayList<CodegenParameter>(); List<CodegenParameter> parameters = new ArrayList<CodegenParameter>();
LOGGER.debug("debugging fromRequestBodyToFormParameters= " + body); LOGGER.debug("debugging fromRequestBodyToFormParameters= " + body);
Schema schema = getSchemaFromBody(body); Schema schema = getSchemaFromBody(body);
if (StringUtils.isNotBlank(schema.get$ref())) {
schema = schemas.get(
getSimpleRef(schema.get$ref())
);
}
if (schema.getProperties() != null && !schema.getProperties().isEmpty()) { if (schema.getProperties() != null && !schema.getProperties().isEmpty()) {
Map<String, Schema> properties = schema.getProperties(); Map<String, Schema> properties = schema.getProperties();
for (Map.Entry<String, Schema> entry : properties.entrySet()) { for (Map.Entry<String, Schema> entry : properties.entrySet()) {

View File

@ -261,7 +261,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) [[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)
# **testEndpointParameters** # **testEndpointParameters**
> testEndpointParameters() > testEndpointParameters($integer, $int32, $int64, $number, $float, $double, $string, $pattern_without_delimiter, $byte, $binary, $date, $date_time, $password, $callback)
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
@ -284,9 +284,23 @@ $apiInstance = new Swagger\Client\Api\FakeApi(
new GuzzleHttp\Client(), new GuzzleHttp\Client(),
$config $config
); );
$integer = 56; // int | None
$int32 = 56; // int | None
$int64 = 56; // int | None
$number = new \Swagger\Client\Model\BigDecimal(); // BigDecimal | None
$float = 3.4; // float | None
$double = 3.4; // double | None
$string = "string_example"; // string | None
$pattern_without_delimiter = "pattern_without_delimiter_example"; // string | None
$byte = "byte_example"; // string | None
$binary = "binary_example"; // string | None
$date = "date_example"; // \DateTime | None
$date_time = "date_time_example"; // \DateTime | None
$password = "password_example"; // string | None
$callback = "callback_example"; // string | None
try { try {
$apiInstance->testEndpointParameters(); $apiInstance->testEndpointParameters($integer, $int32, $int64, $number, $float, $double, $string, $pattern_without_delimiter, $byte, $binary, $date, $date_time, $password, $callback);
} catch (Exception $e) { } catch (Exception $e) {
echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), PHP_EOL; echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), PHP_EOL;
} }
@ -294,7 +308,23 @@ try {
``` ```
### Parameters ### Parameters
This endpoint does not need any parameter.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**integer** | **int**| None | [optional]
**int32** | **int**| None | [optional]
**int64** | **int**| None | [optional]
**number** | **BigDecimal**| None | [optional]
**float** | **float**| None | [optional]
**double** | **double**| None | [optional]
**string** | **string**| None | [optional]
**pattern_without_delimiter** | **string**| None | [optional]
**byte** | **string**| None | [optional]
**binary** | **string**| None | [optional]
**date** | **\DateTime**| None | [optional]
**date_time** | **\DateTime**| None | [optional]
**password** | **string**| None | [optional]
**callback** | **string**| None | [optional]
### Return type ### Return type
@ -312,7 +342,7 @@ void (empty response body)
[[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) [[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)
# **testEnumParameters** # **testEnumParameters**
> testEnumParameters($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer) > testEnumParameters($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_form_string_array, $enum_form_string, $enum_query_double)
To test enum parameters To test enum parameters
@ -333,9 +363,12 @@ $enum_header_string = "enum_header_string_example"; // string | Header parameter
$enum_query_string_array = array("enum_query_string_array_example"); // string[] | Query parameter enum test (string array) $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 = "enum_query_string_example"; // string | Query parameter enum test (string)
$enum_query_integer = 56; // int | Query parameter enum test (double) $enum_query_integer = 56; // int | 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)
$enum_query_double = 3.4; // double | Query parameter enum test (double)
try { try {
$apiInstance->testEnumParameters($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer); $apiInstance->testEnumParameters($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_form_string_array, $enum_form_string, $enum_query_double);
} catch (Exception $e) { } catch (Exception $e) {
echo 'Exception when calling FakeApi->testEnumParameters: ', $e->getMessage(), PHP_EOL; echo 'Exception when calling FakeApi->testEnumParameters: ', $e->getMessage(), PHP_EOL;
} }
@ -351,6 +384,9 @@ Name | Type | Description | Notes
**enum_query_string_array** | [**string[]**](../Model/string.md)| Query parameter enum test (string array) | [optional] **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]
**enum_query_integer** | **int**| Query parameter enum test (double) | [optional] **enum_query_integer** | **int**| Query parameter enum test (double) | [optional]
**enum_form_string_array** | [**string[]**](../Model/array.md)| Form parameter enum test (string array) | [optional]
**enum_form_string** | **string**| Form parameter enum test (string) | [optional]
**enum_query_double** | **double**| Query parameter enum test (double) | [optional]
### Return type ### Return type
@ -414,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) [[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**
> testJsonFormData() > testJsonFormData($param, $param2)
test json serialization of form data test json serialization of form data
@ -428,9 +464,11 @@ $apiInstance = new Swagger\Client\Api\FakeApi(
// This is optional, `GuzzleHttp\Client` will be used as default. // This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client() new GuzzleHttp\Client()
); );
$param = "param_example"; // string | field1
$param2 = "param2_example"; // string | field2
try { try {
$apiInstance->testJsonFormData(); $apiInstance->testJsonFormData($param, $param2);
} catch (Exception $e) { } catch (Exception $e) {
echo 'Exception when calling FakeApi->testJsonFormData: ', $e->getMessage(), PHP_EOL; echo 'Exception when calling FakeApi->testJsonFormData: ', $e->getMessage(), PHP_EOL;
} }
@ -438,7 +476,11 @@ try {
``` ```
### Parameters ### Parameters
This endpoint does not need any parameter.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**param** | **string**| field1 | [optional]
**param2** | **string**| field2 | [optional]
### Return type ### Return type

View File

@ -328,7 +328,7 @@ void (empty response body)
[[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) [[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)
# **updatePetWithForm** # **updatePetWithForm**
> updatePetWithForm($pet_id) > updatePetWithForm($pet_id, $name, $status)
Updates a pet in the store with form data Updates a pet in the store with form data
@ -347,9 +347,11 @@ $apiInstance = new Swagger\Client\Api\PetApi(
$config $config
); );
$pet_id = 789; // int | ID of pet that needs to be updated $pet_id = 789; // 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
try { try {
$apiInstance->updatePetWithForm($pet_id); $apiInstance->updatePetWithForm($pet_id, $name, $status);
} catch (Exception $e) { } catch (Exception $e) {
echo 'Exception when calling PetApi->updatePetWithForm: ', $e->getMessage(), PHP_EOL; echo 'Exception when calling PetApi->updatePetWithForm: ', $e->getMessage(), PHP_EOL;
} }
@ -361,6 +363,8 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**pet_id** | **int**| ID of pet that needs to be updated | **pet_id** | **int**| ID of pet that needs to be updated |
**name** | **string**| Updated name of the pet | [optional]
**status** | **string**| Updated status of the pet | [optional]
### Return type ### Return type
@ -378,7 +382,7 @@ void (empty response body)
[[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) [[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)
# **uploadFile** # **uploadFile**
> \Swagger\Client\Model\ApiResponse uploadFile($pet_id) > \Swagger\Client\Model\ApiResponse uploadFile($pet_id, $additional_metadata, $file)
uploads an image uploads an image
@ -397,9 +401,11 @@ $apiInstance = new Swagger\Client\Api\PetApi(
$config $config
); );
$pet_id = 789; // int | ID of pet to update $pet_id = 789; // int | ID of pet to update
$additional_metadata = "additional_metadata_example"; // string | Additional data to pass to server
$file = "file_example"; // string | file to upload
try { try {
$result = $apiInstance->uploadFile($pet_id); $result = $apiInstance->uploadFile($pet_id, $additional_metadata, $file);
print_r($result); print_r($result);
} catch (Exception $e) { } catch (Exception $e) {
echo 'Exception when calling PetApi->uploadFile: ', $e->getMessage(), PHP_EOL; echo 'Exception when calling PetApi->uploadFile: ', $e->getMessage(), PHP_EOL;
@ -412,6 +418,8 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**pet_id** | **int**| ID of pet to update | **pet_id** | **int**| ID of pet to update |
**additional_metadata** | **string**| Additional data to pass to server | [optional]
**file** | **string**| file to upload | [optional]
### Return type ### Return type

View File

@ -1337,14 +1337,28 @@ class FakeApi
* *
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* *
* @param int $integer None (optional)
* @param int $int32 None (optional)
* @param int $int64 None (optional)
* @param BigDecimal $number None (optional)
* @param float $float None (optional)
* @param double $double None (optional)
* @param string $string None (optional)
* @param string $pattern_without_delimiter None (optional)
* @param string $byte None (optional)
* @param string $binary None (optional)
* @param \DateTime $date None (optional)
* @param \DateTime $date_time None (optional)
* @param string $password None (optional)
* @param string $callback None (optional)
* *
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return void * @return void
*/ */
public function testEndpointParameters() public function testEndpointParameters($integer = null, $int32 = null, $int64 = null, $number = null, $float = null, $double = null, $string = null, $pattern_without_delimiter = null, $byte = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null)
{ {
$this->testEndpointParametersWithHttpInfo(); $this->testEndpointParametersWithHttpInfo($integer, $int32, $int64, $number, $float, $double, $string, $pattern_without_delimiter, $byte, $binary, $date, $date_time, $password, $callback);
} }
/** /**
@ -1352,15 +1366,29 @@ class FakeApi
* *
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* *
* @param int $integer None (optional)
* @param int $int32 None (optional)
* @param int $int64 None (optional)
* @param BigDecimal $number None (optional)
* @param float $float None (optional)
* @param double $double None (optional)
* @param string $string None (optional)
* @param string $pattern_without_delimiter None (optional)
* @param string $byte None (optional)
* @param string $binary None (optional)
* @param \DateTime $date None (optional)
* @param \DateTime $date_time None (optional)
* @param string $password None (optional)
* @param string $callback None (optional)
* *
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings) * @return array of null, HTTP status code, HTTP response headers (array of strings)
*/ */
public function testEndpointParametersWithHttpInfo() public function testEndpointParametersWithHttpInfo($integer = null, $int32 = null, $int64 = null, $number = null, $float = null, $double = null, $string = null, $pattern_without_delimiter = null, $byte = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null)
{ {
$returnType = ''; $returnType = '';
$request = $this->testEndpointParametersRequest(); $request = $this->testEndpointParametersRequest($integer, $int32, $int64, $number, $float, $double, $string, $pattern_without_delimiter, $byte, $binary, $date, $date_time, $password, $callback);
try { try {
$options = $this->createHttpClientOption(); $options = $this->createHttpClientOption();
@ -1404,13 +1432,27 @@ class FakeApi
* *
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* *
* @param int $integer None (optional)
* @param int $int32 None (optional)
* @param int $int64 None (optional)
* @param BigDecimal $number None (optional)
* @param float $float None (optional)
* @param double $double None (optional)
* @param string $string None (optional)
* @param string $pattern_without_delimiter None (optional)
* @param string $byte None (optional)
* @param string $binary None (optional)
* @param \DateTime $date None (optional)
* @param \DateTime $date_time None (optional)
* @param string $password None (optional)
* @param string $callback None (optional)
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface * @return \GuzzleHttp\Promise\PromiseInterface
*/ */
public function testEndpointParametersAsync() public function testEndpointParametersAsync($integer = null, $int32 = null, $int64 = null, $number = null, $float = null, $double = null, $string = null, $pattern_without_delimiter = null, $byte = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null)
{ {
return $this->testEndpointParametersAsyncWithHttpInfo() return $this->testEndpointParametersAsyncWithHttpInfo($integer, $int32, $int64, $number, $float, $double, $string, $pattern_without_delimiter, $byte, $binary, $date, $date_time, $password, $callback)
->then( ->then(
function ($response) { function ($response) {
return $response[0]; return $response[0];
@ -1423,14 +1465,28 @@ class FakeApi
* *
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* *
* @param int $integer None (optional)
* @param int $int32 None (optional)
* @param int $int64 None (optional)
* @param BigDecimal $number None (optional)
* @param float $float None (optional)
* @param double $double None (optional)
* @param string $string None (optional)
* @param string $pattern_without_delimiter None (optional)
* @param string $byte None (optional)
* @param string $binary None (optional)
* @param \DateTime $date None (optional)
* @param \DateTime $date_time None (optional)
* @param string $password None (optional)
* @param string $callback None (optional)
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface * @return \GuzzleHttp\Promise\PromiseInterface
*/ */
public function testEndpointParametersAsyncWithHttpInfo() public function testEndpointParametersAsyncWithHttpInfo($integer = null, $int32 = null, $int64 = null, $number = null, $float = null, $double = null, $string = null, $pattern_without_delimiter = null, $byte = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null)
{ {
$returnType = ''; $returnType = '';
$request = $this->testEndpointParametersRequest(); $request = $this->testEndpointParametersRequest($integer, $int32, $int64, $number, $float, $double, $string, $pattern_without_delimiter, $byte, $binary, $date, $date_time, $password, $callback);
return $this->client return $this->client
->sendAsync($request, $this->createHttpClientOption()) ->sendAsync($request, $this->createHttpClientOption())
@ -1458,12 +1514,65 @@ class FakeApi
/** /**
* Create request for operation 'testEndpointParameters' * Create request for operation 'testEndpointParameters'
* *
* @param int $integer None (optional)
* @param int $int32 None (optional)
* @param int $int64 None (optional)
* @param BigDecimal $number None (optional)
* @param float $float None (optional)
* @param double $double None (optional)
* @param string $string None (optional)
* @param string $pattern_without_delimiter None (optional)
* @param string $byte None (optional)
* @param string $binary None (optional)
* @param \DateTime $date None (optional)
* @param \DateTime $date_time None (optional)
* @param string $password None (optional)
* @param string $callback None (optional)
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request * @return \GuzzleHttp\Psr7\Request
*/ */
protected function testEndpointParametersRequest() protected function testEndpointParametersRequest($integer = null, $int32 = null, $int64 = null, $number = null, $float = null, $double = null, $string = null, $pattern_without_delimiter = null, $byte = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null)
{ {
if ($integer !== null && $integer > 100) {
throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 100.');
}
if ($integer !== null && $integer < 10) {
throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.');
}
if ($int32 !== null && $int32 > 200) {
throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 200.');
}
if ($int32 !== null && $int32 < 20) {
throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 20.');
}
if ($number !== null && $number > 543.2) {
throw new \InvalidArgumentException('invalid value for "$number" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 543.2.');
}
if ($number !== null && $number < 32.1) {
throw new \InvalidArgumentException('invalid value for "$number" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 32.1.');
}
if ($float !== null && $float > 987.6) {
throw new \InvalidArgumentException('invalid value for "$float" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 987.6.');
}
if ($double !== null && $double > 123.4) {
throw new \InvalidArgumentException('invalid value for "$double" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 123.4.');
}
if ($double !== null && $double < 67.8) {
throw new \InvalidArgumentException('invalid value for "$double" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 67.8.');
}
if ($password !== null && strlen($password) > 64) {
throw new \InvalidArgumentException('invalid length for "$password" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 64.');
}
if ($password !== null && strlen($password) < 10) {
throw new \InvalidArgumentException('invalid length for "$password" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.');
}
$resourcePath = '/fake'; $resourcePath = '/fake';
$formParams = []; $formParams = [];
@ -1474,6 +1583,62 @@ class FakeApi
// form params
if ($integer !== null) {
$formParams['integer'] = ObjectSerializer::toFormValue($integer);
}
// form params
if ($int32 !== null) {
$formParams['int32'] = ObjectSerializer::toFormValue($int32);
}
// form params
if ($int64 !== null) {
$formParams['int64'] = ObjectSerializer::toFormValue($int64);
}
// form params
if ($number !== null) {
$formParams['number'] = ObjectSerializer::toFormValue($number);
}
// form params
if ($float !== null) {
$formParams['float'] = ObjectSerializer::toFormValue($float);
}
// form params
if ($double !== null) {
$formParams['double'] = ObjectSerializer::toFormValue($double);
}
// form params
if ($string !== null) {
$formParams['string'] = ObjectSerializer::toFormValue($string);
}
// form params
if ($pattern_without_delimiter !== null) {
$formParams['pattern_without_delimiter'] = ObjectSerializer::toFormValue($pattern_without_delimiter);
}
// form params
if ($byte !== null) {
$formParams['byte'] = ObjectSerializer::toFormValue($byte);
}
// form params
if ($binary !== null) {
$formParams['binary'] = ObjectSerializer::toFormValue($binary);
}
// form params
if ($date !== null) {
$formParams['date'] = ObjectSerializer::toFormValue($date);
}
// form params
if ($date_time !== null) {
$formParams['dateTime'] = ObjectSerializer::toFormValue($date_time);
}
// form params
if ($password !== null) {
$formParams['password'] = ObjectSerializer::toFormValue($password);
}
// form params
if ($callback !== null) {
$formParams['callback'] = ObjectSerializer::toFormValue($callback);
}
// body params // body params
$_tempBody = null; $_tempBody = null;
@ -1552,14 +1717,17 @@ class FakeApi
* @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) * @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)
* @param int $enum_query_integer Query parameter enum test (double) (optional) * @param int $enum_query_integer Query parameter enum test (double) (optional)
* @param string[] $enum_form_string_array Form parameter enum test (string array) (optional)
* @param string $enum_form_string Form parameter enum test (string) (optional)
* @param double $enum_query_double Query parameter enum test (double) (optional)
* *
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return void * @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) 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_form_string_array = null, $enum_form_string = null, $enum_query_double = null)
{ {
$this->testEnumParametersWithHttpInfo($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer); $this->testEnumParametersWithHttpInfo($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_form_string_array, $enum_form_string, $enum_query_double);
} }
/** /**
@ -1572,15 +1740,18 @@ class FakeApi
* @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) * @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)
* @param int $enum_query_integer Query parameter enum test (double) (optional) * @param int $enum_query_integer Query parameter enum test (double) (optional)
* @param string[] $enum_form_string_array Form parameter enum test (string array) (optional)
* @param string $enum_form_string Form parameter enum test (string) (optional)
* @param double $enum_query_double Query parameter enum test (double) (optional)
* *
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings) * @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) 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_form_string_array = null, $enum_form_string = null, $enum_query_double = null)
{ {
$returnType = ''; $returnType = '';
$request = $this->testEnumParametersRequest($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer); $request = $this->testEnumParametersRequest($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_form_string_array, $enum_form_string, $enum_query_double);
try { try {
$options = $this->createHttpClientOption(); $options = $this->createHttpClientOption();
@ -1629,13 +1800,16 @@ class FakeApi
* @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) * @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)
* @param int $enum_query_integer Query parameter enum test (double) (optional) * @param int $enum_query_integer Query parameter enum test (double) (optional)
* @param string[] $enum_form_string_array Form parameter enum test (string array) (optional)
* @param string $enum_form_string Form parameter enum test (string) (optional)
* @param double $enum_query_double Query parameter enum test (double) (optional)
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface * @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) 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_form_string_array = null, $enum_form_string = null, $enum_query_double = null)
{ {
return $this->testEnumParametersAsyncWithHttpInfo($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer) return $this->testEnumParametersAsyncWithHttpInfo($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_form_string_array, $enum_form_string, $enum_query_double)
->then( ->then(
function ($response) { function ($response) {
return $response[0]; return $response[0];
@ -1653,14 +1827,17 @@ class FakeApi
* @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) * @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)
* @param int $enum_query_integer Query parameter enum test (double) (optional) * @param int $enum_query_integer Query parameter enum test (double) (optional)
* @param string[] $enum_form_string_array Form parameter enum test (string array) (optional)
* @param string $enum_form_string Form parameter enum test (string) (optional)
* @param double $enum_query_double Query parameter enum test (double) (optional)
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface * @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) 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_form_string_array = null, $enum_form_string = null, $enum_query_double = null)
{ {
$returnType = ''; $returnType = '';
$request = $this->testEnumParametersRequest($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer); $request = $this->testEnumParametersRequest($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_form_string_array, $enum_form_string, $enum_query_double);
return $this->client return $this->client
->sendAsync($request, $this->createHttpClientOption()) ->sendAsync($request, $this->createHttpClientOption())
@ -1693,11 +1870,14 @@ class FakeApi
* @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) * @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)
* @param int $enum_query_integer Query parameter enum test (double) (optional) * @param int $enum_query_integer Query parameter enum test (double) (optional)
* @param string[] $enum_form_string_array Form parameter enum test (string array) (optional)
* @param string $enum_form_string Form parameter enum test (string) (optional)
* @param double $enum_query_double Query parameter enum test (double) (optional)
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request * @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) 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_form_string_array = null, $enum_form_string = null, $enum_query_double = null)
{ {
$resourcePath = '/fake'; $resourcePath = '/fake';
@ -1732,6 +1912,18 @@ class FakeApi
} }
// form params
if ($enum_form_string_array !== null) {
$formParams['enum_form_string_array'] = ObjectSerializer::toFormValue($enum_form_string_array);
}
// form params
if ($enum_form_string !== null) {
$formParams['enum_form_string'] = ObjectSerializer::toFormValue($enum_form_string);
}
// form params
if ($enum_query_double !== null) {
$formParams['enum_query_double'] = ObjectSerializer::toFormValue($enum_query_double);
}
// body params // body params
$_tempBody = null; $_tempBody = null;
@ -2021,14 +2213,16 @@ class FakeApi
* *
* test json serialization of form data * test json serialization of form data
* *
* @param string $param field1 (optional)
* @param string $param2 field2 (optional)
* *
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return void * @return void
*/ */
public function testJsonFormData() public function testJsonFormData($param = null, $param2 = null)
{ {
$this->testJsonFormDataWithHttpInfo(); $this->testJsonFormDataWithHttpInfo($param, $param2);
} }
/** /**
@ -2036,15 +2230,17 @@ class FakeApi
* *
* test json serialization of form data * test json serialization of form data
* *
* @param string $param field1 (optional)
* @param string $param2 field2 (optional)
* *
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings) * @return array of null, HTTP status code, HTTP response headers (array of strings)
*/ */
public function testJsonFormDataWithHttpInfo() public function testJsonFormDataWithHttpInfo($param = null, $param2 = null)
{ {
$returnType = ''; $returnType = '';
$request = $this->testJsonFormDataRequest(); $request = $this->testJsonFormDataRequest($param, $param2);
try { try {
$options = $this->createHttpClientOption(); $options = $this->createHttpClientOption();
@ -2088,13 +2284,15 @@ class FakeApi
* *
* test json serialization of form data * test json serialization of form data
* *
* @param string $param field1 (optional)
* @param string $param2 field2 (optional)
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface * @return \GuzzleHttp\Promise\PromiseInterface
*/ */
public function testJsonFormDataAsync() public function testJsonFormDataAsync($param = null, $param2 = null)
{ {
return $this->testJsonFormDataAsyncWithHttpInfo() return $this->testJsonFormDataAsyncWithHttpInfo($param, $param2)
->then( ->then(
function ($response) { function ($response) {
return $response[0]; return $response[0];
@ -2107,14 +2305,16 @@ class FakeApi
* *
* test json serialization of form data * test json serialization of form data
* *
* @param string $param field1 (optional)
* @param string $param2 field2 (optional)
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface * @return \GuzzleHttp\Promise\PromiseInterface
*/ */
public function testJsonFormDataAsyncWithHttpInfo() public function testJsonFormDataAsyncWithHttpInfo($param = null, $param2 = null)
{ {
$returnType = ''; $returnType = '';
$request = $this->testJsonFormDataRequest(); $request = $this->testJsonFormDataRequest($param, $param2);
return $this->client return $this->client
->sendAsync($request, $this->createHttpClientOption()) ->sendAsync($request, $this->createHttpClientOption())
@ -2142,11 +2342,13 @@ class FakeApi
/** /**
* Create request for operation 'testJsonFormData' * Create request for operation 'testJsonFormData'
* *
* @param string $param field1 (optional)
* @param string $param2 field2 (optional)
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request * @return \GuzzleHttp\Psr7\Request
*/ */
protected function testJsonFormDataRequest() protected function testJsonFormDataRequest($param = null, $param2 = null)
{ {
$resourcePath = '/fake/jsonFormData'; $resourcePath = '/fake/jsonFormData';
@ -2158,6 +2360,14 @@ class FakeApi
// form params
if ($param !== null) {
$formParams['param'] = ObjectSerializer::toFormValue($param);
}
// form params
if ($param2 !== null) {
$formParams['param2'] = ObjectSerializer::toFormValue($param2);
}
// body params // body params
$_tempBody = null; $_tempBody = null;

View File

@ -1576,14 +1576,16 @@ class PetApi
* Updates a pet in the store with form data * Updates a pet in the store with form data
* *
* @param int $pet_id ID of pet that needs to be updated (required) * @param int $pet_id ID of pet that needs to be updated (required)
* @param string $name Updated name of the pet (optional)
* @param string $status Updated status of the pet (optional)
* *
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return void * @return void
*/ */
public function updatePetWithForm($pet_id) public function updatePetWithForm($pet_id, $name = null, $status = null)
{ {
$this->updatePetWithFormWithHttpInfo($pet_id); $this->updatePetWithFormWithHttpInfo($pet_id, $name, $status);
} }
/** /**
@ -1592,15 +1594,17 @@ class PetApi
* Updates a pet in the store with form data * Updates a pet in the store with form data
* *
* @param int $pet_id ID of pet that needs to be updated (required) * @param int $pet_id ID of pet that needs to be updated (required)
* @param string $name Updated name of the pet (optional)
* @param string $status Updated status of the pet (optional)
* *
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings) * @return array of null, HTTP status code, HTTP response headers (array of strings)
*/ */
public function updatePetWithFormWithHttpInfo($pet_id) public function updatePetWithFormWithHttpInfo($pet_id, $name = null, $status = null)
{ {
$returnType = ''; $returnType = '';
$request = $this->updatePetWithFormRequest($pet_id); $request = $this->updatePetWithFormRequest($pet_id, $name, $status);
try { try {
$options = $this->createHttpClientOption(); $options = $this->createHttpClientOption();
@ -1645,13 +1649,15 @@ class PetApi
* Updates a pet in the store with form data * Updates a pet in the store with form data
* *
* @param int $pet_id ID of pet that needs to be updated (required) * @param int $pet_id ID of pet that needs to be updated (required)
* @param string $name Updated name of the pet (optional)
* @param string $status Updated status of the pet (optional)
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface * @return \GuzzleHttp\Promise\PromiseInterface
*/ */
public function updatePetWithFormAsync($pet_id) public function updatePetWithFormAsync($pet_id, $name = null, $status = null)
{ {
return $this->updatePetWithFormAsyncWithHttpInfo($pet_id) return $this->updatePetWithFormAsyncWithHttpInfo($pet_id, $name, $status)
->then( ->then(
function ($response) { function ($response) {
return $response[0]; return $response[0];
@ -1665,14 +1671,16 @@ class PetApi
* Updates a pet in the store with form data * Updates a pet in the store with form data
* *
* @param int $pet_id ID of pet that needs to be updated (required) * @param int $pet_id ID of pet that needs to be updated (required)
* @param string $name Updated name of the pet (optional)
* @param string $status Updated status of the pet (optional)
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface * @return \GuzzleHttp\Promise\PromiseInterface
*/ */
public function updatePetWithFormAsyncWithHttpInfo($pet_id) public function updatePetWithFormAsyncWithHttpInfo($pet_id, $name = null, $status = null)
{ {
$returnType = ''; $returnType = '';
$request = $this->updatePetWithFormRequest($pet_id); $request = $this->updatePetWithFormRequest($pet_id, $name, $status);
return $this->client return $this->client
->sendAsync($request, $this->createHttpClientOption()) ->sendAsync($request, $this->createHttpClientOption())
@ -1701,11 +1709,13 @@ class PetApi
* Create request for operation 'updatePetWithForm' * Create request for operation 'updatePetWithForm'
* *
* @param int $pet_id ID of pet that needs to be updated (required) * @param int $pet_id ID of pet that needs to be updated (required)
* @param string $name Updated name of the pet (optional)
* @param string $status Updated status of the pet (optional)
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request * @return \GuzzleHttp\Psr7\Request
*/ */
protected function updatePetWithFormRequest($pet_id) protected function updatePetWithFormRequest($pet_id, $name = null, $status = null)
{ {
// verify the required parameter 'pet_id' is set // verify the required parameter 'pet_id' is set
if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) { if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) {
@ -1731,6 +1741,14 @@ class PetApi
); );
} }
// form params
if ($name !== null) {
$formParams['name'] = ObjectSerializer::toFormValue($name);
}
// form params
if ($status !== null) {
$formParams['status'] = ObjectSerializer::toFormValue($status);
}
// body params // body params
$_tempBody = null; $_tempBody = null;
@ -1805,14 +1823,16 @@ class PetApi
* uploads an image * uploads an image
* *
* @param int $pet_id ID of pet to update (required) * @param int $pet_id ID of pet to update (required)
* @param string $additional_metadata Additional data to pass to server (optional)
* @param string $file file to upload (optional)
* *
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return \Swagger\Client\Model\ApiResponse * @return \Swagger\Client\Model\ApiResponse
*/ */
public function uploadFile($pet_id) public function uploadFile($pet_id, $additional_metadata = null, $file = null)
{ {
list($response) = $this->uploadFileWithHttpInfo($pet_id); list($response) = $this->uploadFileWithHttpInfo($pet_id, $additional_metadata, $file);
return $response; return $response;
} }
@ -1822,15 +1842,17 @@ class PetApi
* uploads an image * uploads an image
* *
* @param int $pet_id ID of pet to update (required) * @param int $pet_id ID of pet to update (required)
* @param string $additional_metadata Additional data to pass to server (optional)
* @param string $file file to upload (optional)
* *
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return array of \Swagger\Client\Model\ApiResponse, HTTP status code, HTTP response headers (array of strings) * @return array of \Swagger\Client\Model\ApiResponse, HTTP status code, HTTP response headers (array of strings)
*/ */
public function uploadFileWithHttpInfo($pet_id) public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $file = null)
{ {
$returnType = '\Swagger\Client\Model\ApiResponse'; $returnType = '\Swagger\Client\Model\ApiResponse';
$request = $this->uploadFileRequest($pet_id); $request = $this->uploadFileRequest($pet_id, $additional_metadata, $file);
try { try {
$options = $this->createHttpClientOption(); $options = $this->createHttpClientOption();
@ -1897,13 +1919,15 @@ class PetApi
* uploads an image * uploads an image
* *
* @param int $pet_id ID of pet to update (required) * @param int $pet_id ID of pet to update (required)
* @param string $additional_metadata Additional data to pass to server (optional)
* @param string $file file to upload (optional)
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface * @return \GuzzleHttp\Promise\PromiseInterface
*/ */
public function uploadFileAsync($pet_id) public function uploadFileAsync($pet_id, $additional_metadata = null, $file = null)
{ {
return $this->uploadFileAsyncWithHttpInfo($pet_id) return $this->uploadFileAsyncWithHttpInfo($pet_id, $additional_metadata, $file)
->then( ->then(
function ($response) { function ($response) {
return $response[0]; return $response[0];
@ -1917,14 +1941,16 @@ class PetApi
* uploads an image * uploads an image
* *
* @param int $pet_id ID of pet to update (required) * @param int $pet_id ID of pet to update (required)
* @param string $additional_metadata Additional data to pass to server (optional)
* @param string $file file to upload (optional)
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface * @return \GuzzleHttp\Promise\PromiseInterface
*/ */
public function uploadFileAsyncWithHttpInfo($pet_id) public function uploadFileAsyncWithHttpInfo($pet_id, $additional_metadata = null, $file = null)
{ {
$returnType = '\Swagger\Client\Model\ApiResponse'; $returnType = '\Swagger\Client\Model\ApiResponse';
$request = $this->uploadFileRequest($pet_id); $request = $this->uploadFileRequest($pet_id, $additional_metadata, $file);
return $this->client return $this->client
->sendAsync($request, $this->createHttpClientOption()) ->sendAsync($request, $this->createHttpClientOption())
@ -1967,11 +1993,13 @@ class PetApi
* Create request for operation 'uploadFile' * Create request for operation 'uploadFile'
* *
* @param int $pet_id ID of pet to update (required) * @param int $pet_id ID of pet to update (required)
* @param string $additional_metadata Additional data to pass to server (optional)
* @param string $file file to upload (optional)
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request * @return \GuzzleHttp\Psr7\Request
*/ */
protected function uploadFileRequest($pet_id) protected function uploadFileRequest($pet_id, $additional_metadata = null, $file = null)
{ {
// verify the required parameter 'pet_id' is set // verify the required parameter 'pet_id' is set
if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) { if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) {
@ -1997,6 +2025,14 @@ class PetApi
); );
} }
// form params
if ($additional_metadata !== null) {
$formParams['additionalMetadata'] = ObjectSerializer::toFormValue($additional_metadata);
}
// form params
if ($file !== null) {
$formParams['file'] = ObjectSerializer::toFormValue($file);
}
// body params // body params
$_tempBody = null; $_tempBody = null;