forked from loafle/openapi-generator-original
add more tests such as empty response (#14587)
This commit is contained in:
@@ -11,6 +11,8 @@ docs/Category.md
|
||||
docs/DataQuery.md
|
||||
docs/DataQueryAllOf.md
|
||||
docs/DefaultValue.md
|
||||
docs/FormApi.md
|
||||
docs/HeaderApi.md
|
||||
docs/PathApi.md
|
||||
docs/Pet.md
|
||||
docs/Query.md
|
||||
@@ -41,6 +43,8 @@ src/main/java/org/openapitools/client/ServerConfiguration.java
|
||||
src/main/java/org/openapitools/client/ServerVariable.java
|
||||
src/main/java/org/openapitools/client/StringUtil.java
|
||||
src/main/java/org/openapitools/client/api/BodyApi.java
|
||||
src/main/java/org/openapitools/client/api/FormApi.java
|
||||
src/main/java/org/openapitools/client/api/HeaderApi.java
|
||||
src/main/java/org/openapitools/client/api/PathApi.java
|
||||
src/main/java/org/openapitools/client/api/QueryApi.java
|
||||
src/main/java/org/openapitools/client/auth/ApiKeyAuth.java
|
||||
|
||||
@@ -114,6 +114,9 @@ All URIs are relative to *http://localhost:3000*
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*BodyApi* | [**testEchoBodyPet**](docs/BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s)
|
||||
*BodyApi* | [**testEchoBodyPetResponseString**](docs/BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body
|
||||
*FormApi* | [**testFormIntegerBooleanString**](docs/FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s)
|
||||
*HeaderApi* | [**testHeaderIntegerBooleanString**](docs/HeaderApi.md#testHeaderIntegerBooleanString) | **GET** /header/integer/boolean/string | Test header parameter(s)
|
||||
*PathApi* | [**testsPathStringPathStringIntegerPathInteger**](docs/PathApi.md#testsPathStringPathStringIntegerPathInteger) | **GET** /path/string/{path_string}/integer/{path_integer} | Test path parameter(s)
|
||||
*QueryApi* | [**testQueryIntegerBooleanString**](docs/QueryApi.md#testQueryIntegerBooleanString) | **GET** /query/integer/boolean/string | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryStyleDeepObjectExplodeTrueObject**](docs/QueryApi.md#testQueryStyleDeepObjectExplodeTrueObject) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s)
|
||||
|
||||
@@ -41,6 +41,64 @@ paths:
|
||||
tags:
|
||||
- path
|
||||
x-accepts: text/plain
|
||||
/form/integer/boolean/string:
|
||||
post:
|
||||
description: Test form parameter(s)
|
||||
operationId: test/form/integer/boolean/string
|
||||
requestBody:
|
||||
content:
|
||||
application/x-www-form-urlencoded:
|
||||
schema:
|
||||
$ref: '#/components/schemas/test_form_integer_boolean_string_request'
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
description: Successful operation
|
||||
summary: Test form parameter(s)
|
||||
tags:
|
||||
- form
|
||||
x-content-type: application/x-www-form-urlencoded
|
||||
x-accepts: text/plain
|
||||
/header/integer/boolean/string:
|
||||
get:
|
||||
description: Test header parameter(s)
|
||||
operationId: test/header/integer/boolean/string
|
||||
parameters:
|
||||
- explode: true
|
||||
in: header
|
||||
name: integer_header
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
style: form
|
||||
- explode: true
|
||||
in: header
|
||||
name: boolean_header
|
||||
required: false
|
||||
schema:
|
||||
type: boolean
|
||||
style: form
|
||||
- explode: true
|
||||
in: header
|
||||
name: string_header
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
style: form
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
description: Successful operation
|
||||
summary: Test header parameter(s)
|
||||
tags:
|
||||
- header
|
||||
x-accepts: text/plain
|
||||
/query/integer/boolean/string:
|
||||
get:
|
||||
description: Test query parameter(s)
|
||||
@@ -211,6 +269,24 @@ paths:
|
||||
- body
|
||||
x-content-type: application/json
|
||||
x-accepts: application/json
|
||||
/echo/body/Pet/response_string:
|
||||
post:
|
||||
description: Test empty response body
|
||||
operationId: test/echo/body/Pet/response_string
|
||||
requestBody:
|
||||
$ref: '#/components/requestBodies/Pet'
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
description: Successful operation
|
||||
summary: Test empty response body
|
||||
tags:
|
||||
- body
|
||||
x-content-type: application/json
|
||||
x-accepts: text/plain
|
||||
components:
|
||||
requestBodies:
|
||||
Pet:
|
||||
@@ -372,6 +448,15 @@ components:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/DataQuery_allOf'
|
||||
- $ref: '#/components/schemas/Query'
|
||||
test_form_integer_boolean_string_request:
|
||||
properties:
|
||||
integer_form:
|
||||
type: integer
|
||||
boolean_form:
|
||||
type: boolean
|
||||
string_form:
|
||||
type: string
|
||||
type: object
|
||||
test_query_style_form_explode_true_array_string_query_object_parameter:
|
||||
properties:
|
||||
values:
|
||||
|
||||
@@ -5,6 +5,7 @@ All URIs are relative to *http://localhost:3000*
|
||||
| Method | HTTP request | Description |
|
||||
|------------- | ------------- | -------------|
|
||||
| [**testEchoBodyPet**](BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s) |
|
||||
| [**testEchoBodyPetResponseString**](BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body |
|
||||
|
||||
|
||||
<a name="testEchoBodyPet"></a>
|
||||
@@ -69,3 +70,65 @@ No authorization required
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
<a name="testEchoBodyPetResponseString"></a>
|
||||
# **testEchoBodyPetResponseString**
|
||||
> String testEchoBodyPetResponseString(pet)
|
||||
|
||||
Test empty response body
|
||||
|
||||
Test empty response body
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.BodyApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://localhost:3000");
|
||||
|
||||
BodyApi apiInstance = new BodyApi(defaultClient);
|
||||
Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
try {
|
||||
String result = apiInstance.testEchoBodyPetResponseString(pet);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling BodyApi#testEchoBodyPetResponseString");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: text/plain
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
|
||||
75
samples/client/echo_api/java/okhttp-gson/docs/FormApi.md
Normal file
75
samples/client/echo_api/java/okhttp-gson/docs/FormApi.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# FormApi
|
||||
|
||||
All URIs are relative to *http://localhost:3000*
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
|------------- | ------------- | -------------|
|
||||
| [**testFormIntegerBooleanString**](FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s) |
|
||||
|
||||
|
||||
<a name="testFormIntegerBooleanString"></a>
|
||||
# **testFormIntegerBooleanString**
|
||||
> String testFormIntegerBooleanString(integerForm, booleanForm, stringForm)
|
||||
|
||||
Test form parameter(s)
|
||||
|
||||
Test form parameter(s)
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.FormApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://localhost:3000");
|
||||
|
||||
FormApi apiInstance = new FormApi(defaultClient);
|
||||
Integer integerForm = 56; // Integer |
|
||||
Boolean booleanForm = true; // Boolean |
|
||||
String stringForm = "stringForm_example"; // String |
|
||||
try {
|
||||
String result = apiInstance.testFormIntegerBooleanString(integerForm, booleanForm, stringForm);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FormApi#testFormIntegerBooleanString");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **integerForm** | **Integer**| | [optional] |
|
||||
| **booleanForm** | **Boolean**| | [optional] |
|
||||
| **stringForm** | **String**| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: text/plain
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
75
samples/client/echo_api/java/okhttp-gson/docs/HeaderApi.md
Normal file
75
samples/client/echo_api/java/okhttp-gson/docs/HeaderApi.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# HeaderApi
|
||||
|
||||
All URIs are relative to *http://localhost:3000*
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
|------------- | ------------- | -------------|
|
||||
| [**testHeaderIntegerBooleanString**](HeaderApi.md#testHeaderIntegerBooleanString) | **GET** /header/integer/boolean/string | Test header parameter(s) |
|
||||
|
||||
|
||||
<a name="testHeaderIntegerBooleanString"></a>
|
||||
# **testHeaderIntegerBooleanString**
|
||||
> String testHeaderIntegerBooleanString(integerHeader, booleanHeader, stringHeader)
|
||||
|
||||
Test header parameter(s)
|
||||
|
||||
Test header parameter(s)
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.HeaderApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://localhost:3000");
|
||||
|
||||
HeaderApi apiInstance = new HeaderApi(defaultClient);
|
||||
Integer integerHeader = 56; // Integer |
|
||||
Boolean booleanHeader = true; // Boolean |
|
||||
String stringHeader = "stringHeader_example"; // String |
|
||||
try {
|
||||
String result = apiInstance.testHeaderIntegerBooleanString(integerHeader, booleanHeader, stringHeader);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling HeaderApi#testHeaderIntegerBooleanString");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **integerHeader** | **Integer**| | [optional] |
|
||||
| **booleanHeader** | **Boolean**| | [optional] |
|
||||
| **stringHeader** | **String**| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
@@ -191,4 +191,122 @@ public class BodyApi {
|
||||
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
|
||||
return localVarCall;
|
||||
}
|
||||
/**
|
||||
* Build call for testEchoBodyPetResponseString
|
||||
* @param pet Pet object that needs to be added to the store (optional)
|
||||
* @param _callback Callback for upload/download progress
|
||||
* @return Call to execute
|
||||
* @throws ApiException If fail to serialize the request body object
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public okhttp3.Call testEchoBodyPetResponseStringCall(Pet pet, final ApiCallback _callback) throws ApiException {
|
||||
String basePath = null;
|
||||
// Operation Servers
|
||||
String[] localBasePaths = new String[] { };
|
||||
|
||||
// Determine Base Path to Use
|
||||
if (localCustomBaseUrl != null){
|
||||
basePath = localCustomBaseUrl;
|
||||
} else if ( localBasePaths.length > 0 ) {
|
||||
basePath = localBasePaths[localHostIndex];
|
||||
} else {
|
||||
basePath = null;
|
||||
}
|
||||
|
||||
Object localVarPostBody = pet;
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/echo/body/Pet/response_string";
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarCookieParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"text/plain"
|
||||
};
|
||||
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) {
|
||||
localVarHeaderParams.put("Accept", localVarAccept);
|
||||
}
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
|
||||
if (localVarContentType != null) {
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private okhttp3.Call testEchoBodyPetResponseStringValidateBeforeCall(Pet pet, final ApiCallback _callback) throws ApiException {
|
||||
return testEchoBodyPetResponseStringCall(pet, _callback);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test empty response body
|
||||
* Test empty response body
|
||||
* @param pet Pet object that needs to be added to the store (optional)
|
||||
* @return String
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public String testEchoBodyPetResponseString(Pet pet) throws ApiException {
|
||||
ApiResponse<String> localVarResp = testEchoBodyPetResponseStringWithHttpInfo(pet);
|
||||
return localVarResp.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test empty response body
|
||||
* Test empty response body
|
||||
* @param pet Pet object that needs to be added to the store (optional)
|
||||
* @return ApiResponse<String>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public ApiResponse<String> testEchoBodyPetResponseStringWithHttpInfo(Pet pet) throws ApiException {
|
||||
okhttp3.Call localVarCall = testEchoBodyPetResponseStringValidateBeforeCall(pet, null);
|
||||
Type localVarReturnType = new TypeToken<String>(){}.getType();
|
||||
return localVarApiClient.execute(localVarCall, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test empty response body (asynchronously)
|
||||
* Test empty response body
|
||||
* @param pet Pet object that needs to be added to the store (optional)
|
||||
* @param _callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public okhttp3.Call testEchoBodyPetResponseStringAsync(Pet pet, final ApiCallback<String> _callback) throws ApiException {
|
||||
|
||||
okhttp3.Call localVarCall = testEchoBodyPetResponseStringValidateBeforeCall(pet, _callback);
|
||||
Type localVarReturnType = new TypeToken<String>(){}.getType();
|
||||
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
|
||||
return localVarCall;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,213 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiCallback;
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.Pair;
|
||||
import org.openapitools.client.ProgressRequestBody;
|
||||
import org.openapitools.client.ProgressResponseBody;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.ws.rs.core.GenericType;
|
||||
|
||||
public class FormApi {
|
||||
private ApiClient localVarApiClient;
|
||||
private int localHostIndex;
|
||||
private String localCustomBaseUrl;
|
||||
|
||||
public FormApi() {
|
||||
this(Configuration.getDefaultApiClient());
|
||||
}
|
||||
|
||||
public FormApi(ApiClient apiClient) {
|
||||
this.localVarApiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return localVarApiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.localVarApiClient = apiClient;
|
||||
}
|
||||
|
||||
public int getHostIndex() {
|
||||
return localHostIndex;
|
||||
}
|
||||
|
||||
public void setHostIndex(int hostIndex) {
|
||||
this.localHostIndex = hostIndex;
|
||||
}
|
||||
|
||||
public String getCustomBaseUrl() {
|
||||
return localCustomBaseUrl;
|
||||
}
|
||||
|
||||
public void setCustomBaseUrl(String customBaseUrl) {
|
||||
this.localCustomBaseUrl = customBaseUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build call for testFormIntegerBooleanString
|
||||
* @param integerForm (optional)
|
||||
* @param booleanForm (optional)
|
||||
* @param stringForm (optional)
|
||||
* @param _callback Callback for upload/download progress
|
||||
* @return Call to execute
|
||||
* @throws ApiException If fail to serialize the request body object
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public okhttp3.Call testFormIntegerBooleanStringCall(Integer integerForm, Boolean booleanForm, String stringForm, final ApiCallback _callback) throws ApiException {
|
||||
String basePath = null;
|
||||
// Operation Servers
|
||||
String[] localBasePaths = new String[] { };
|
||||
|
||||
// Determine Base Path to Use
|
||||
if (localCustomBaseUrl != null){
|
||||
basePath = localCustomBaseUrl;
|
||||
} else if ( localBasePaths.length > 0 ) {
|
||||
basePath = localBasePaths[localHostIndex];
|
||||
} else {
|
||||
basePath = null;
|
||||
}
|
||||
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/form/integer/boolean/string";
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarCookieParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
if (integerForm != null) {
|
||||
localVarFormParams.put("integer_form", integerForm);
|
||||
}
|
||||
|
||||
if (booleanForm != null) {
|
||||
localVarFormParams.put("boolean_form", booleanForm);
|
||||
}
|
||||
|
||||
if (stringForm != null) {
|
||||
localVarFormParams.put("string_form", stringForm);
|
||||
}
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"text/plain"
|
||||
};
|
||||
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) {
|
||||
localVarHeaderParams.put("Accept", localVarAccept);
|
||||
}
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
|
||||
if (localVarContentType != null) {
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private okhttp3.Call testFormIntegerBooleanStringValidateBeforeCall(Integer integerForm, Boolean booleanForm, String stringForm, final ApiCallback _callback) throws ApiException {
|
||||
return testFormIntegerBooleanStringCall(integerForm, booleanForm, stringForm, _callback);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test form parameter(s)
|
||||
* Test form parameter(s)
|
||||
* @param integerForm (optional)
|
||||
* @param booleanForm (optional)
|
||||
* @param stringForm (optional)
|
||||
* @return String
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public String testFormIntegerBooleanString(Integer integerForm, Boolean booleanForm, String stringForm) throws ApiException {
|
||||
ApiResponse<String> localVarResp = testFormIntegerBooleanStringWithHttpInfo(integerForm, booleanForm, stringForm);
|
||||
return localVarResp.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test form parameter(s)
|
||||
* Test form parameter(s)
|
||||
* @param integerForm (optional)
|
||||
* @param booleanForm (optional)
|
||||
* @param stringForm (optional)
|
||||
* @return ApiResponse<String>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public ApiResponse<String> testFormIntegerBooleanStringWithHttpInfo(Integer integerForm, Boolean booleanForm, String stringForm) throws ApiException {
|
||||
okhttp3.Call localVarCall = testFormIntegerBooleanStringValidateBeforeCall(integerForm, booleanForm, stringForm, null);
|
||||
Type localVarReturnType = new TypeToken<String>(){}.getType();
|
||||
return localVarApiClient.execute(localVarCall, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test form parameter(s) (asynchronously)
|
||||
* Test form parameter(s)
|
||||
* @param integerForm (optional)
|
||||
* @param booleanForm (optional)
|
||||
* @param stringForm (optional)
|
||||
* @param _callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public okhttp3.Call testFormIntegerBooleanStringAsync(Integer integerForm, Boolean booleanForm, String stringForm, final ApiCallback<String> _callback) throws ApiException {
|
||||
|
||||
okhttp3.Call localVarCall = testFormIntegerBooleanStringValidateBeforeCall(integerForm, booleanForm, stringForm, _callback);
|
||||
Type localVarReturnType = new TypeToken<String>(){}.getType();
|
||||
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
|
||||
return localVarCall;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiCallback;
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.Pair;
|
||||
import org.openapitools.client.ProgressRequestBody;
|
||||
import org.openapitools.client.ProgressResponseBody;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.ws.rs.core.GenericType;
|
||||
|
||||
public class HeaderApi {
|
||||
private ApiClient localVarApiClient;
|
||||
private int localHostIndex;
|
||||
private String localCustomBaseUrl;
|
||||
|
||||
public HeaderApi() {
|
||||
this(Configuration.getDefaultApiClient());
|
||||
}
|
||||
|
||||
public HeaderApi(ApiClient apiClient) {
|
||||
this.localVarApiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return localVarApiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.localVarApiClient = apiClient;
|
||||
}
|
||||
|
||||
public int getHostIndex() {
|
||||
return localHostIndex;
|
||||
}
|
||||
|
||||
public void setHostIndex(int hostIndex) {
|
||||
this.localHostIndex = hostIndex;
|
||||
}
|
||||
|
||||
public String getCustomBaseUrl() {
|
||||
return localCustomBaseUrl;
|
||||
}
|
||||
|
||||
public void setCustomBaseUrl(String customBaseUrl) {
|
||||
this.localCustomBaseUrl = customBaseUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build call for testHeaderIntegerBooleanString
|
||||
* @param integerHeader (optional)
|
||||
* @param booleanHeader (optional)
|
||||
* @param stringHeader (optional)
|
||||
* @param _callback Callback for upload/download progress
|
||||
* @return Call to execute
|
||||
* @throws ApiException If fail to serialize the request body object
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public okhttp3.Call testHeaderIntegerBooleanStringCall(Integer integerHeader, Boolean booleanHeader, String stringHeader, final ApiCallback _callback) throws ApiException {
|
||||
String basePath = null;
|
||||
// Operation Servers
|
||||
String[] localBasePaths = new String[] { };
|
||||
|
||||
// Determine Base Path to Use
|
||||
if (localCustomBaseUrl != null){
|
||||
basePath = localCustomBaseUrl;
|
||||
} else if ( localBasePaths.length > 0 ) {
|
||||
basePath = localBasePaths[localHostIndex];
|
||||
} else {
|
||||
basePath = null;
|
||||
}
|
||||
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/header/integer/boolean/string";
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarCookieParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
if (integerHeader != null) {
|
||||
localVarHeaderParams.put("integer_header", localVarApiClient.parameterToString(integerHeader));
|
||||
}
|
||||
|
||||
if (booleanHeader != null) {
|
||||
localVarHeaderParams.put("boolean_header", localVarApiClient.parameterToString(booleanHeader));
|
||||
}
|
||||
|
||||
if (stringHeader != null) {
|
||||
localVarHeaderParams.put("string_header", localVarApiClient.parameterToString(stringHeader));
|
||||
}
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"text/plain"
|
||||
};
|
||||
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) {
|
||||
localVarHeaderParams.put("Accept", localVarAccept);
|
||||
}
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
};
|
||||
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
|
||||
if (localVarContentType != null) {
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private okhttp3.Call testHeaderIntegerBooleanStringValidateBeforeCall(Integer integerHeader, Boolean booleanHeader, String stringHeader, final ApiCallback _callback) throws ApiException {
|
||||
return testHeaderIntegerBooleanStringCall(integerHeader, booleanHeader, stringHeader, _callback);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test header parameter(s)
|
||||
* Test header parameter(s)
|
||||
* @param integerHeader (optional)
|
||||
* @param booleanHeader (optional)
|
||||
* @param stringHeader (optional)
|
||||
* @return String
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public String testHeaderIntegerBooleanString(Integer integerHeader, Boolean booleanHeader, String stringHeader) throws ApiException {
|
||||
ApiResponse<String> localVarResp = testHeaderIntegerBooleanStringWithHttpInfo(integerHeader, booleanHeader, stringHeader);
|
||||
return localVarResp.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test header parameter(s)
|
||||
* Test header parameter(s)
|
||||
* @param integerHeader (optional)
|
||||
* @param booleanHeader (optional)
|
||||
* @param stringHeader (optional)
|
||||
* @return ApiResponse<String>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public ApiResponse<String> testHeaderIntegerBooleanStringWithHttpInfo(Integer integerHeader, Boolean booleanHeader, String stringHeader) throws ApiException {
|
||||
okhttp3.Call localVarCall = testHeaderIntegerBooleanStringValidateBeforeCall(integerHeader, booleanHeader, stringHeader, null);
|
||||
Type localVarReturnType = new TypeToken<String>(){}.getType();
|
||||
return localVarApiClient.execute(localVarCall, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test header parameter(s) (asynchronously)
|
||||
* Test header parameter(s)
|
||||
* @param integerHeader (optional)
|
||||
* @param booleanHeader (optional)
|
||||
* @param stringHeader (optional)
|
||||
* @param _callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public okhttp3.Call testHeaderIntegerBooleanStringAsync(Integer integerHeader, Boolean booleanHeader, String stringHeader, final ApiCallback<String> _callback) throws ApiException {
|
||||
|
||||
okhttp3.Call localVarCall = testHeaderIntegerBooleanStringValidateBeforeCall(integerHeader, booleanHeader, stringHeader, _callback);
|
||||
Type localVarReturnType = new TypeToken<String>(){}.getType();
|
||||
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
|
||||
return localVarCall;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* API tests for FormApi
|
||||
*/
|
||||
@Disabled
|
||||
public class FormApiTest {
|
||||
|
||||
private final FormApi api = new FormApi();
|
||||
|
||||
/**
|
||||
* Test form parameter(s)
|
||||
*
|
||||
* Test form parameter(s)
|
||||
*
|
||||
* @throws ApiException if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testFormIntegerBooleanStringTest() throws ApiException {
|
||||
Integer integerForm = null;
|
||||
Boolean booleanForm = null;
|
||||
String stringForm = null;
|
||||
String response = api.testFormIntegerBooleanString(integerForm, booleanForm, stringForm);
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* API tests for HeaderApi
|
||||
*/
|
||||
@Disabled
|
||||
public class HeaderApiTest {
|
||||
|
||||
private final HeaderApi api = new HeaderApi();
|
||||
|
||||
/**
|
||||
* Test header parameter(s)
|
||||
*
|
||||
* Test header parameter(s)
|
||||
*
|
||||
* @throws ApiException if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testHeaderIntegerBooleanStringTest() throws ApiException {
|
||||
Integer integerHeader = null;
|
||||
Boolean booleanHeader = null;
|
||||
String stringHeader = null;
|
||||
String response = api.testHeaderIntegerBooleanString(integerHeader, booleanHeader, stringHeader);
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user