mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-08 04:36:09 +00:00
add more tests such as empty response (#14587)
This commit is contained in:
@@ -56,6 +56,67 @@ paths:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
# form parameter tests
|
||||
/form/integer/boolean/string:
|
||||
post:
|
||||
tags:
|
||||
- form
|
||||
summary: Test form parameter(s)
|
||||
description: Test form parameter(s)
|
||||
operationId: test/form/integer/boolean/string
|
||||
requestBody:
|
||||
content:
|
||||
application/x-www-form-urlencoded:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
integer_form:
|
||||
type: integer
|
||||
boolean_form:
|
||||
type: boolean
|
||||
string_form:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: Successful operation
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
# header parameter tests
|
||||
/header/integer/boolean/string:
|
||||
get:
|
||||
tags:
|
||||
- header
|
||||
summary: Test header parameter(s)
|
||||
description: Test header parameter(s)
|
||||
operationId: test/header/integer/boolean/string
|
||||
parameters:
|
||||
- in: header
|
||||
name: integer_header
|
||||
style: form #default
|
||||
explode: true #default
|
||||
schema:
|
||||
type: integer
|
||||
- in: header
|
||||
name: boolean_header
|
||||
style: form #default
|
||||
explode: true #default
|
||||
schema:
|
||||
type: boolean
|
||||
- in: header
|
||||
name: string_header
|
||||
style: form #default
|
||||
explode: true #default
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: Successful operation
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
# query parameter tests
|
||||
/query/integer/boolean/string:
|
||||
get:
|
||||
@@ -218,6 +279,22 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
/echo/body/Pet/response_string:
|
||||
post:
|
||||
tags:
|
||||
- body
|
||||
summary: Test empty response body
|
||||
description: Test empty response body
|
||||
operationId: test/echo/body/Pet/response_string
|
||||
requestBody:
|
||||
$ref: '#/components/requestBodies/Pet'
|
||||
responses:
|
||||
'200':
|
||||
description: Successful operation
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
|
||||
components:
|
||||
requestBodies:
|
||||
|
||||
@@ -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
|
||||
@@ -37,6 +39,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
|
||||
|
||||
@@ -107,6 +107,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 |
|
||||
|
||||
|
||||
|
||||
@@ -73,3 +74,69 @@ No authorization required
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
|
||||
## 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 | - |
|
||||
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
# 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) |
|
||||
|
||||
|
||||
|
||||
## 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 | - |
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
# 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) |
|
||||
|
||||
|
||||
|
||||
## 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 | - |
|
||||
|
||||
@@ -102,4 +102,57 @@ public class BodyApi {
|
||||
localVarReturnType
|
||||
);
|
||||
}
|
||||
/**
|
||||
* 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 fails to make API call
|
||||
*/
|
||||
public String testEchoBodyPetResponseString(Pet pet) throws ApiException {
|
||||
Object localVarPostBody = pet;
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/echo/body/Pet/response_string";
|
||||
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
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 = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
TypeReference<String> localVarReturnType = new TypeReference<String>() {};
|
||||
return apiClient.invokeAPI(
|
||||
localVarPath,
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
localVarFormParams,
|
||||
localVarAccept,
|
||||
localVarContentType,
|
||||
localVarAuthNames,
|
||||
localVarReturnType
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* 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 com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.model.*;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class FormApi {
|
||||
private ApiClient apiClient;
|
||||
|
||||
public FormApi() {
|
||||
this(Configuration.getDefaultApiClient());
|
||||
}
|
||||
|
||||
public FormApi(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test form parameter(s)
|
||||
* Test form parameter(s)
|
||||
* @param integerForm (optional)
|
||||
* @param booleanForm (optional)
|
||||
* @param stringForm (optional)
|
||||
* @return String
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testFormIntegerBooleanString(Integer integerForm, Boolean booleanForm, String stringForm) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/form/integer/boolean/string";
|
||||
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
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 = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
TypeReference<String> localVarReturnType = new TypeReference<String>() {};
|
||||
return apiClient.invokeAPI(
|
||||
localVarPath,
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
localVarFormParams,
|
||||
localVarAccept,
|
||||
localVarContentType,
|
||||
localVarAuthNames,
|
||||
localVarReturnType
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* 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 com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.model.*;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class HeaderApi {
|
||||
private ApiClient apiClient;
|
||||
|
||||
public HeaderApi() {
|
||||
this(Configuration.getDefaultApiClient());
|
||||
}
|
||||
|
||||
public HeaderApi(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test header parameter(s)
|
||||
* Test header parameter(s)
|
||||
* @param integerHeader (optional)
|
||||
* @param booleanHeader (optional)
|
||||
* @param stringHeader (optional)
|
||||
* @return String
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testHeaderIntegerBooleanString(Integer integerHeader, Boolean booleanHeader, String stringHeader) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/header/integer/boolean/string";
|
||||
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
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", apiClient.parameterToString(integerHeader));
|
||||
if (booleanHeader != null)
|
||||
localVarHeaderParams.put("boolean_header", apiClient.parameterToString(booleanHeader));
|
||||
if (stringHeader != null)
|
||||
localVarHeaderParams.put("string_header", apiClient.parameterToString(stringHeader));
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"text/plain"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
TypeReference<String> localVarReturnType = new TypeReference<String>() {};
|
||||
return apiClient.invokeAPI(
|
||||
localVarPath,
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
localVarFormParams,
|
||||
localVarAccept,
|
||||
localVarContentType,
|
||||
localVarAuthNames,
|
||||
localVarReturnType
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,20 @@ public class CustomTest {
|
||||
Assert.assertNull(p2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test body parameter(s)
|
||||
* <p>
|
||||
* Test body parameter(s)
|
||||
*
|
||||
* @throws ApiException if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testEchoBodyPetResponseString() throws ApiException {
|
||||
// response is empty body
|
||||
String p2 = bodyApi.testEchoBodyPetResponseString(null);
|
||||
Assert.assertNull(p2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* <p>
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.Test;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Assert;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* API tests for FormApi
|
||||
*/
|
||||
@Ignore
|
||||
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,53 @@
|
||||
/*
|
||||
* 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.Test;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Assert;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* API tests for HeaderApi
|
||||
*/
|
||||
@Ignore
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -44,4 +44,33 @@ public interface BodyApi extends ApiClient.Api {
|
||||
ApiResponse<Pet> testEchoBodyPetWithHttpInfo(Pet pet);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Test empty response body
|
||||
* Test empty response body
|
||||
* @param pet Pet object that needs to be added to the store (optional)
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("POST /echo/body/Pet/response_string")
|
||||
@Headers({
|
||||
"Content-Type: application/json",
|
||||
"Accept: text/plain",
|
||||
})
|
||||
String testEchoBodyPetResponseString(Pet pet);
|
||||
|
||||
/**
|
||||
* Test empty response body
|
||||
* Similar to <code>testEchoBodyPetResponseString</code> but it also returns the http response headers .
|
||||
* Test empty response body
|
||||
* @param pet Pet object that needs to be added to the store (optional)
|
||||
* @return A ApiResponse that wraps the response boyd and the http headers.
|
||||
*/
|
||||
@RequestLine("POST /echo/body/Pet/response_string")
|
||||
@Headers({
|
||||
"Content-Type: application/json",
|
||||
"Accept: text/plain",
|
||||
})
|
||||
ApiResponse<String> testEchoBodyPetResponseStringWithHttpInfo(Pet pet);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.EncodingUtils;
|
||||
import org.openapitools.client.model.ApiResponse;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import feign.*;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public interface FormApi extends ApiClient.Api {
|
||||
|
||||
|
||||
/**
|
||||
* Test form parameter(s)
|
||||
* Test form parameter(s)
|
||||
* @param integerForm (optional)
|
||||
* @param booleanForm (optional)
|
||||
* @param stringForm (optional)
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("POST /form/integer/boolean/string")
|
||||
@Headers({
|
||||
"Content-Type: application/x-www-form-urlencoded",
|
||||
"Accept: text/plain",
|
||||
})
|
||||
String testFormIntegerBooleanString(@Param("integer_form") Integer integerForm, @Param("boolean_form") Boolean booleanForm, @Param("string_form") String stringForm);
|
||||
|
||||
/**
|
||||
* Test form parameter(s)
|
||||
* Similar to <code>testFormIntegerBooleanString</code> but it also returns the http response headers .
|
||||
* Test form parameter(s)
|
||||
* @param integerForm (optional)
|
||||
* @param booleanForm (optional)
|
||||
* @param stringForm (optional)
|
||||
* @return A ApiResponse that wraps the response boyd and the http headers.
|
||||
*/
|
||||
@RequestLine("POST /form/integer/boolean/string")
|
||||
@Headers({
|
||||
"Content-Type: application/x-www-form-urlencoded",
|
||||
"Accept: text/plain",
|
||||
})
|
||||
ApiResponse<String> testFormIntegerBooleanStringWithHttpInfo(@Param("integer_form") Integer integerForm, @Param("boolean_form") Boolean booleanForm, @Param("string_form") String stringForm);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.EncodingUtils;
|
||||
import org.openapitools.client.model.ApiResponse;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import feign.*;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public interface HeaderApi extends ApiClient.Api {
|
||||
|
||||
|
||||
/**
|
||||
* Test header parameter(s)
|
||||
* Test header parameter(s)
|
||||
* @param integerHeader (optional)
|
||||
* @param booleanHeader (optional)
|
||||
* @param stringHeader (optional)
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("GET /header/integer/boolean/string")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
"integer_header: {integerHeader}",
|
||||
|
||||
"boolean_header: {booleanHeader}",
|
||||
|
||||
"string_header: {stringHeader}"
|
||||
})
|
||||
String testHeaderIntegerBooleanString(@Param("integerHeader") Integer integerHeader, @Param("booleanHeader") Boolean booleanHeader, @Param("stringHeader") String stringHeader);
|
||||
|
||||
/**
|
||||
* Test header parameter(s)
|
||||
* Similar to <code>testHeaderIntegerBooleanString</code> but it also returns the http response headers .
|
||||
* Test header parameter(s)
|
||||
* @param integerHeader (optional)
|
||||
* @param booleanHeader (optional)
|
||||
* @param stringHeader (optional)
|
||||
* @return A ApiResponse that wraps the response boyd and the http headers.
|
||||
*/
|
||||
@RequestLine("GET /header/integer/boolean/string")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
"integer_header: {integerHeader}",
|
||||
|
||||
"boolean_header: {booleanHeader}",
|
||||
|
||||
"string_header: {stringHeader}"
|
||||
})
|
||||
ApiResponse<String> testHeaderIntegerBooleanStringWithHttpInfo(@Param("integerHeader") Integer integerHeader, @Param("booleanHeader") Boolean booleanHeader, @Param("stringHeader") String stringHeader);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* API tests for FormApi
|
||||
*/
|
||||
class FormApiTest {
|
||||
|
||||
private FormApi api;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
api = new ApiClient().buildClient(FormApi.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test form parameter(s)
|
||||
*
|
||||
* Test form parameter(s)
|
||||
*/
|
||||
@Test
|
||||
void testFormIntegerBooleanStringTest() {
|
||||
Integer integerForm = null;
|
||||
Boolean booleanForm = null;
|
||||
String stringForm = null;
|
||||
// String response = api.testFormIntegerBooleanString(integerForm, booleanForm, stringForm);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* API tests for HeaderApi
|
||||
*/
|
||||
class HeaderApiTest {
|
||||
|
||||
private HeaderApi api;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
api = new ApiClient().buildClient(HeaderApi.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test header parameter(s)
|
||||
*
|
||||
* Test header parameter(s)
|
||||
*/
|
||||
@Test
|
||||
void testHeaderIntegerBooleanStringTest() {
|
||||
Integer integerHeader = null;
|
||||
Boolean booleanHeader = null;
|
||||
String stringHeader = null;
|
||||
// String response = api.testHeaderIntegerBooleanString(integerHeader, booleanHeader, stringHeader);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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
|
||||
@@ -37,6 +39,8 @@ src/main/java/org/openapitools/client/RFC3339DateFormat.java
|
||||
src/main/java/org/openapitools/client/ServerConfiguration.java
|
||||
src/main/java/org/openapitools/client/ServerVariable.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/model/AbstractOpenApiSchema.java
|
||||
|
||||
@@ -107,6 +107,12 @@ Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*BodyApi* | [**testEchoBodyPet**](docs/BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s)
|
||||
*BodyApi* | [**testEchoBodyPetWithHttpInfo**](docs/BodyApi.md#testEchoBodyPetWithHttpInfo) | **POST** /echo/body/Pet | Test body parameter(s)
|
||||
*BodyApi* | [**testEchoBodyPetResponseString**](docs/BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body
|
||||
*BodyApi* | [**testEchoBodyPetResponseStringWithHttpInfo**](docs/BodyApi.md#testEchoBodyPetResponseStringWithHttpInfo) | **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)
|
||||
*FormApi* | [**testFormIntegerBooleanStringWithHttpInfo**](docs/FormApi.md#testFormIntegerBooleanStringWithHttpInfo) | **POST** /form/integer/boolean/string | Test form parameter(s)
|
||||
*HeaderApi* | [**testHeaderIntegerBooleanString**](docs/HeaderApi.md#testHeaderIntegerBooleanString) | **GET** /header/integer/boolean/string | Test header parameter(s)
|
||||
*HeaderApi* | [**testHeaderIntegerBooleanStringWithHttpInfo**](docs/HeaderApi.md#testHeaderIntegerBooleanStringWithHttpInfo) | **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)
|
||||
*PathApi* | [**testsPathStringPathStringIntegerPathIntegerWithHttpInfo**](docs/PathApi.md#testsPathStringPathStringIntegerPathIntegerWithHttpInfo) | **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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -6,6 +6,8 @@ All URIs are relative to *http://localhost:3000*
|
||||
|------------- | ------------- | -------------|
|
||||
| [**testEchoBodyPet**](BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s) |
|
||||
| [**testEchoBodyPetWithHttpInfo**](BodyApi.md#testEchoBodyPetWithHttpInfo) | **POST** /echo/body/Pet | Test body parameter(s) |
|
||||
| [**testEchoBodyPetResponseString**](BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body |
|
||||
| [**testEchoBodyPetResponseStringWithHttpInfo**](BodyApi.md#testEchoBodyPetResponseStringWithHttpInfo) | **POST** /echo/body/Pet/response_string | Test empty response body |
|
||||
|
||||
|
||||
|
||||
@@ -142,3 +144,137 @@ No authorization required
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
|
||||
## 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 | - |
|
||||
|
||||
## testEchoBodyPetResponseStringWithHttpInfo
|
||||
|
||||
> ApiResponse<String> testEchoBodyPetResponseString testEchoBodyPetResponseStringWithHttpInfo(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.ApiResponse;
|
||||
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 {
|
||||
ApiResponse<String> response = apiInstance.testEchoBodyPetResponseStringWithHttpInfo(pet);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders());
|
||||
System.out.println("Response body: " + response.getData());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling BodyApi#testEchoBodyPetResponseString");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
ApiResponse<**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 | - |
|
||||
|
||||
|
||||
152
samples/client/echo_api/java/native/docs/FormApi.md
Normal file
152
samples/client/echo_api/java/native/docs/FormApi.md
Normal file
@@ -0,0 +1,152 @@
|
||||
# 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) |
|
||||
| [**testFormIntegerBooleanStringWithHttpInfo**](FormApi.md#testFormIntegerBooleanStringWithHttpInfo) | **POST** /form/integer/boolean/string | Test form parameter(s) |
|
||||
|
||||
|
||||
|
||||
## 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 | - |
|
||||
|
||||
## testFormIntegerBooleanStringWithHttpInfo
|
||||
|
||||
> ApiResponse<String> testFormIntegerBooleanString testFormIntegerBooleanStringWithHttpInfo(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.ApiResponse;
|
||||
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 {
|
||||
ApiResponse<String> response = apiInstance.testFormIntegerBooleanStringWithHttpInfo(integerForm, booleanForm, stringForm);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders());
|
||||
System.out.println("Response body: " + response.getData());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FormApi#testFormIntegerBooleanString");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **integerForm** | **Integer**| | [optional] |
|
||||
| **booleanForm** | **Boolean**| | [optional] |
|
||||
| **stringForm** | **String**| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
ApiResponse<**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 | - |
|
||||
|
||||
152
samples/client/echo_api/java/native/docs/HeaderApi.md
Normal file
152
samples/client/echo_api/java/native/docs/HeaderApi.md
Normal file
@@ -0,0 +1,152 @@
|
||||
# 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) |
|
||||
| [**testHeaderIntegerBooleanStringWithHttpInfo**](HeaderApi.md#testHeaderIntegerBooleanStringWithHttpInfo) | **GET** /header/integer/boolean/string | Test header parameter(s) |
|
||||
|
||||
|
||||
|
||||
## 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 | - |
|
||||
|
||||
## testHeaderIntegerBooleanStringWithHttpInfo
|
||||
|
||||
> ApiResponse<String> testHeaderIntegerBooleanString testHeaderIntegerBooleanStringWithHttpInfo(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.ApiResponse;
|
||||
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 {
|
||||
ApiResponse<String> response = apiInstance.testHeaderIntegerBooleanStringWithHttpInfo(integerHeader, booleanHeader, stringHeader);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders());
|
||||
System.out.println("Response body: " + response.getData());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling HeaderApi#testHeaderIntegerBooleanString");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **integerHeader** | **Integer**| | [optional] |
|
||||
| **booleanHeader** | **Boolean**| | [optional] |
|
||||
| **stringHeader** | **String**| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
ApiResponse<**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 | - |
|
||||
|
||||
@@ -133,6 +133,87 @@ public class BodyApi {
|
||||
localVarRequestBuilder.header("Content-Type", "application/json");
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(pet);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* 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 fails to make API call
|
||||
*/
|
||||
public String testEchoBodyPetResponseString(Pet pet) throws ApiException {
|
||||
ApiResponse<String> localVarResponse = testEchoBodyPetResponseStringWithHttpInfo(pet);
|
||||
return localVarResponse.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 fails to make API call
|
||||
*/
|
||||
public ApiResponse<String> testEchoBodyPetResponseStringWithHttpInfo(Pet pet) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = testEchoBodyPetResponseStringRequestBuilder(pet);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
try {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw getApiException("testEchoBodyPetResponseString", localVarResponse);
|
||||
}
|
||||
// for plain text response
|
||||
if (localVarResponse.headers().map().containsKey("Content-Type") &&
|
||||
"text/plain".equalsIgnoreCase(localVarResponse.headers().map().get("Content-Type").get(0))) {
|
||||
java.util.Scanner s = new java.util.Scanner(localVarResponse.body()).useDelimiter("\\A");
|
||||
String responseBodyText = s.hasNext() ? s.next() : "";
|
||||
return new ApiResponse<String>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
responseBodyText
|
||||
);
|
||||
} else {
|
||||
throw new RuntimeException("Error! The response Content-Type is supposed to be `text/plain` but it's not: " + localVarResponse);
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder testEchoBodyPetResponseStringRequestBuilder(Pet pet) throws ApiException {
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/echo/body/Pet/response_string";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Content-Type", "application/json");
|
||||
localVarRequestBuilder.header("Accept", "text/plain");
|
||||
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(pet);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* 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.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.time.Duration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.StringJoiner;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class FormApi {
|
||||
private final HttpClient memberVarHttpClient;
|
||||
private final ObjectMapper memberVarObjectMapper;
|
||||
private final String memberVarBaseUri;
|
||||
private final Consumer<HttpRequest.Builder> memberVarInterceptor;
|
||||
private final Duration memberVarReadTimeout;
|
||||
private final Consumer<HttpResponse<InputStream>> memberVarResponseInterceptor;
|
||||
private final Consumer<HttpResponse<String>> memberVarAsyncResponseInterceptor;
|
||||
|
||||
public FormApi() {
|
||||
this(new ApiClient());
|
||||
}
|
||||
|
||||
public FormApi(ApiClient apiClient) {
|
||||
memberVarHttpClient = apiClient.getHttpClient();
|
||||
memberVarObjectMapper = apiClient.getObjectMapper();
|
||||
memberVarBaseUri = apiClient.getBaseUri();
|
||||
memberVarInterceptor = apiClient.getRequestInterceptor();
|
||||
memberVarReadTimeout = apiClient.getReadTimeout();
|
||||
memberVarResponseInterceptor = apiClient.getResponseInterceptor();
|
||||
memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor();
|
||||
}
|
||||
|
||||
protected ApiException getApiException(String operationId, HttpResponse<InputStream> response) throws IOException {
|
||||
String body = response.body() == null ? null : new String(response.body().readAllBytes());
|
||||
String message = formatExceptionMessage(operationId, response.statusCode(), body);
|
||||
return new ApiException(response.statusCode(), message, response.headers(), body);
|
||||
}
|
||||
|
||||
private String formatExceptionMessage(String operationId, int statusCode, String body) {
|
||||
if (body == null || body.isEmpty()) {
|
||||
body = "[no body]";
|
||||
}
|
||||
return operationId + " call failed with: " + statusCode + " - " + body;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test form parameter(s)
|
||||
* Test form parameter(s)
|
||||
* @param integerForm (optional)
|
||||
* @param booleanForm (optional)
|
||||
* @param stringForm (optional)
|
||||
* @return String
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testFormIntegerBooleanString(Integer integerForm, Boolean booleanForm, String stringForm) throws ApiException {
|
||||
ApiResponse<String> localVarResponse = testFormIntegerBooleanStringWithHttpInfo(integerForm, booleanForm, stringForm);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test form parameter(s)
|
||||
* Test form parameter(s)
|
||||
* @param integerForm (optional)
|
||||
* @param booleanForm (optional)
|
||||
* @param stringForm (optional)
|
||||
* @return ApiResponse<String>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<String> testFormIntegerBooleanStringWithHttpInfo(Integer integerForm, Boolean booleanForm, String stringForm) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = testFormIntegerBooleanStringRequestBuilder(integerForm, booleanForm, stringForm);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
try {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw getApiException("testFormIntegerBooleanString", localVarResponse);
|
||||
}
|
||||
// for plain text response
|
||||
if (localVarResponse.headers().map().containsKey("Content-Type") &&
|
||||
"text/plain".equalsIgnoreCase(localVarResponse.headers().map().get("Content-Type").get(0))) {
|
||||
java.util.Scanner s = new java.util.Scanner(localVarResponse.body()).useDelimiter("\\A");
|
||||
String responseBodyText = s.hasNext() ? s.next() : "";
|
||||
return new ApiResponse<String>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
responseBodyText
|
||||
);
|
||||
} else {
|
||||
throw new RuntimeException("Error! The response Content-Type is supposed to be `text/plain` but it's not: " + localVarResponse);
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder testFormIntegerBooleanStringRequestBuilder(Integer integerForm, Boolean booleanForm, String stringForm) throws ApiException {
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/form/integer/boolean/string";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "text/plain");
|
||||
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
/*
|
||||
* 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.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.time.Duration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.StringJoiner;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class HeaderApi {
|
||||
private final HttpClient memberVarHttpClient;
|
||||
private final ObjectMapper memberVarObjectMapper;
|
||||
private final String memberVarBaseUri;
|
||||
private final Consumer<HttpRequest.Builder> memberVarInterceptor;
|
||||
private final Duration memberVarReadTimeout;
|
||||
private final Consumer<HttpResponse<InputStream>> memberVarResponseInterceptor;
|
||||
private final Consumer<HttpResponse<String>> memberVarAsyncResponseInterceptor;
|
||||
|
||||
public HeaderApi() {
|
||||
this(new ApiClient());
|
||||
}
|
||||
|
||||
public HeaderApi(ApiClient apiClient) {
|
||||
memberVarHttpClient = apiClient.getHttpClient();
|
||||
memberVarObjectMapper = apiClient.getObjectMapper();
|
||||
memberVarBaseUri = apiClient.getBaseUri();
|
||||
memberVarInterceptor = apiClient.getRequestInterceptor();
|
||||
memberVarReadTimeout = apiClient.getReadTimeout();
|
||||
memberVarResponseInterceptor = apiClient.getResponseInterceptor();
|
||||
memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor();
|
||||
}
|
||||
|
||||
protected ApiException getApiException(String operationId, HttpResponse<InputStream> response) throws IOException {
|
||||
String body = response.body() == null ? null : new String(response.body().readAllBytes());
|
||||
String message = formatExceptionMessage(operationId, response.statusCode(), body);
|
||||
return new ApiException(response.statusCode(), message, response.headers(), body);
|
||||
}
|
||||
|
||||
private String formatExceptionMessage(String operationId, int statusCode, String body) {
|
||||
if (body == null || body.isEmpty()) {
|
||||
body = "[no body]";
|
||||
}
|
||||
return operationId + " call failed with: " + statusCode + " - " + body;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test header parameter(s)
|
||||
* Test header parameter(s)
|
||||
* @param integerHeader (optional)
|
||||
* @param booleanHeader (optional)
|
||||
* @param stringHeader (optional)
|
||||
* @return String
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testHeaderIntegerBooleanString(Integer integerHeader, Boolean booleanHeader, String stringHeader) throws ApiException {
|
||||
ApiResponse<String> localVarResponse = testHeaderIntegerBooleanStringWithHttpInfo(integerHeader, booleanHeader, stringHeader);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test header parameter(s)
|
||||
* Test header parameter(s)
|
||||
* @param integerHeader (optional)
|
||||
* @param booleanHeader (optional)
|
||||
* @param stringHeader (optional)
|
||||
* @return ApiResponse<String>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<String> testHeaderIntegerBooleanStringWithHttpInfo(Integer integerHeader, Boolean booleanHeader, String stringHeader) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = testHeaderIntegerBooleanStringRequestBuilder(integerHeader, booleanHeader, stringHeader);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
try {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw getApiException("testHeaderIntegerBooleanString", localVarResponse);
|
||||
}
|
||||
// for plain text response
|
||||
if (localVarResponse.headers().map().containsKey("Content-Type") &&
|
||||
"text/plain".equalsIgnoreCase(localVarResponse.headers().map().get("Content-Type").get(0))) {
|
||||
java.util.Scanner s = new java.util.Scanner(localVarResponse.body()).useDelimiter("\\A");
|
||||
String responseBodyText = s.hasNext() ? s.next() : "";
|
||||
return new ApiResponse<String>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
responseBodyText
|
||||
);
|
||||
} else {
|
||||
throw new RuntimeException("Error! The response Content-Type is supposed to be `text/plain` but it's not: " + localVarResponse);
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder testHeaderIntegerBooleanStringRequestBuilder(Integer integerHeader, Boolean booleanHeader, String stringHeader) throws ApiException {
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/header/integer/boolean/string";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
if (integerHeader != null) {
|
||||
localVarRequestBuilder.header("integer_header", integerHeader.toString());
|
||||
}
|
||||
if (booleanHeader != null) {
|
||||
localVarRequestBuilder.header("boolean_header", booleanHeader.toString());
|
||||
}
|
||||
if (stringHeader != null) {
|
||||
localVarRequestBuilder.header("string_header", stringHeader.toString());
|
||||
}
|
||||
localVarRequestBuilder.header("Accept", "text/plain");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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.Test;
|
||||
import org.junit.Ignore;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
/**
|
||||
* API tests for FormApi
|
||||
*/
|
||||
@Ignore
|
||||
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,55 @@
|
||||
/*
|
||||
* 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.Test;
|
||||
import org.junit.Ignore;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
/**
|
||||
* API tests for HeaderApi
|
||||
*/
|
||||
@Ignore
|
||||
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
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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