forked from loafle/openapi-generator-original
Update samples
This commit is contained in:
parent
4b812935b8
commit
c7bf3360b7
@ -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)
|
[[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($param, $param2)
|
> testJsonFormData($body_4)
|
||||||
|
|
||||||
test json serialization of form data
|
test json serialization of form data
|
||||||
|
|
||||||
@ -464,11 +464,10 @@ $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
|
$body_4 = new \Swagger\Client\Model\Body4(); // \Swagger\Client\Model\Body4 |
|
||||||
$param2 = "param2_example"; // string | field2
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$apiInstance->testJsonFormData($param, $param2);
|
$apiInstance->testJsonFormData($body_4);
|
||||||
} 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;
|
||||||
}
|
}
|
||||||
@ -479,8 +478,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**param** | **string**| field1 |
|
**body_4** | [**\Swagger\Client\Model\Body4**](../Model/Body4.md)| | [optional]
|
||||||
**param2** | **string**| field2 |
|
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -492,7 +490,7 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/x-www-form-urlencoded
|
- **Content-Type**: application/json
|
||||||
- **Accept**: Not defined
|
- **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)
|
[[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)
|
||||||
|
@ -2239,16 +2239,15 @@ class FakeApi
|
|||||||
*
|
*
|
||||||
* test json serialization of form data
|
* test json serialization of form data
|
||||||
*
|
*
|
||||||
* @param string $param field1 (required)
|
* @param \Swagger\Client\Model\Body4 $body_4 body_4 (optional)
|
||||||
* @param string $param2 field2 (required)
|
|
||||||
*
|
*
|
||||||
* @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($param, $param2)
|
public function testJsonFormData($body_4 = null)
|
||||||
{
|
{
|
||||||
$this->testJsonFormDataWithHttpInfo($param, $param2);
|
$this->testJsonFormDataWithHttpInfo($body_4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2256,17 +2255,16 @@ class FakeApi
|
|||||||
*
|
*
|
||||||
* test json serialization of form data
|
* test json serialization of form data
|
||||||
*
|
*
|
||||||
* @param string $param field1 (required)
|
* @param \Swagger\Client\Model\Body4 $body_4 (optional)
|
||||||
* @param string $param2 field2 (required)
|
|
||||||
*
|
*
|
||||||
* @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($param, $param2)
|
public function testJsonFormDataWithHttpInfo($body_4 = null)
|
||||||
{
|
{
|
||||||
$returnType = '';
|
$returnType = '';
|
||||||
$request = $this->testJsonFormDataRequest($param, $param2);
|
$request = $this->testJsonFormDataRequest($body_4);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$options = $this->createHttpClientOption();
|
$options = $this->createHttpClientOption();
|
||||||
@ -2310,15 +2308,14 @@ class FakeApi
|
|||||||
*
|
*
|
||||||
* test json serialization of form data
|
* test json serialization of form data
|
||||||
*
|
*
|
||||||
* @param string $param field1 (required)
|
* @param \Swagger\Client\Model\Body4 $body_4 (optional)
|
||||||
* @param string $param2 field2 (required)
|
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
* @return \GuzzleHttp\Promise\PromiseInterface
|
* @return \GuzzleHttp\Promise\PromiseInterface
|
||||||
*/
|
*/
|
||||||
public function testJsonFormDataAsync($param, $param2)
|
public function testJsonFormDataAsync($body_4 = null)
|
||||||
{
|
{
|
||||||
return $this->testJsonFormDataAsyncWithHttpInfo($param, $param2)
|
return $this->testJsonFormDataAsyncWithHttpInfo($body_4)
|
||||||
->then(
|
->then(
|
||||||
function ($response) {
|
function ($response) {
|
||||||
return $response[0];
|
return $response[0];
|
||||||
@ -2331,16 +2328,15 @@ class FakeApi
|
|||||||
*
|
*
|
||||||
* test json serialization of form data
|
* test json serialization of form data
|
||||||
*
|
*
|
||||||
* @param string $param field1 (required)
|
* @param \Swagger\Client\Model\Body4 $body_4 (optional)
|
||||||
* @param string $param2 field2 (required)
|
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
* @return \GuzzleHttp\Promise\PromiseInterface
|
* @return \GuzzleHttp\Promise\PromiseInterface
|
||||||
*/
|
*/
|
||||||
public function testJsonFormDataAsyncWithHttpInfo($param, $param2)
|
public function testJsonFormDataAsyncWithHttpInfo($body_4 = null)
|
||||||
{
|
{
|
||||||
$returnType = '';
|
$returnType = '';
|
||||||
$request = $this->testJsonFormDataRequest($param, $param2);
|
$request = $this->testJsonFormDataRequest($body_4);
|
||||||
|
|
||||||
return $this->client
|
return $this->client
|
||||||
->sendAsync($request, $this->createHttpClientOption())
|
->sendAsync($request, $this->createHttpClientOption())
|
||||||
@ -2368,26 +2364,13 @@ class FakeApi
|
|||||||
/**
|
/**
|
||||||
* Create request for operation 'testJsonFormData'
|
* Create request for operation 'testJsonFormData'
|
||||||
*
|
*
|
||||||
* @param string $param field1 (required)
|
* @param \Swagger\Client\Model\Body4 $body_4 (optional)
|
||||||
* @param string $param2 field2 (required)
|
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
* @return \GuzzleHttp\Psr7\Request
|
* @return \GuzzleHttp\Psr7\Request
|
||||||
*/
|
*/
|
||||||
protected function testJsonFormDataRequest($param, $param2)
|
protected function testJsonFormDataRequest($body_4 = null)
|
||||||
{
|
{
|
||||||
// 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';
|
$resourcePath = '/fake/jsonFormData';
|
||||||
$formParams = [];
|
$formParams = [];
|
||||||
@ -2398,16 +2381,11 @@ 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;
|
||||||
|
if (isset($body_4)) {
|
||||||
|
$_tempBody = $body_4;
|
||||||
|
}
|
||||||
|
|
||||||
if ($multipart) {
|
if ($multipart) {
|
||||||
$headers = $this->headerSelector->selectHeadersForMultipart(
|
$headers = $this->headerSelector->selectHeadersForMultipart(
|
||||||
@ -2416,7 +2394,7 @@ class FakeApi
|
|||||||
} else {
|
} else {
|
||||||
$headers = $this->headerSelector->selectHeaders(
|
$headers = $this->headerSelector->selectHeaders(
|
||||||
[],
|
[],
|
||||||
['application/x-www-form-urlencoded']
|
['application/json']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user