[python-nextgen] fix empty dict in body parameter (#15336)

* add more tests for python-nextgen

* update samples

* add fix for empty dict body

* update samples
This commit is contained in:
William Cheng
2023-04-28 14:06:27 +08:00
committed by GitHub
parent f4c041e496
commit 2bd1a15217
32 changed files with 1873 additions and 46 deletions

View File

@@ -106,8 +106,10 @@ All URIs are relative to *http://localhost:3000*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*BodyApi* | [**testBinaryGif**](docs/BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body
*BodyApi* | [**testEchoBodyFreeFormObjectResponseString**](docs/BodyApi.md#testEchoBodyFreeFormObjectResponseString) | **POST** /echo/body/FreeFormObject/response_string | Test free form object
*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
*BodyApi* | [**testEchoBodyTagResponseString**](docs/BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request 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)

View File

@@ -349,6 +349,46 @@ paths:
- body
x-content-type: application/json
x-accepts: text/plain
/echo/body/Tag/response_string:
post:
description: Test empty json (request body)
operationId: test/echo/body/Tag/response_string
requestBody:
$ref: '#/components/requestBodies/Tag'
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test empty json (request body)
tags:
- body
x-content-type: application/json
x-accepts: text/plain
/echo/body/FreeFormObject/response_string:
post:
description: Test free form object
operationId: test/echo/body/FreeFormObject/response_string
requestBody:
content:
application/json:
schema:
type: object
description: Free form object
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test free form object
tags:
- body
x-content-type: application/json
x-accepts: text/plain
/binary/gif:
post:
description: Test binary (gif) response body
@@ -373,6 +413,12 @@ components:
schema:
$ref: '#/components/schemas/Pet'
description: Pet object that needs to be added to the store
Tag:
content:
application/json:
schema:
$ref: '#/components/schemas/Tag'
description: Tag object
schemas:
Category:
example:

View File

@@ -5,8 +5,10 @@ All URIs are relative to *http://localhost:3000*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**testBinaryGif**](BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body |
| [**testEchoBodyFreeFormObjectResponseString**](BodyApi.md#testEchoBodyFreeFormObjectResponseString) | **POST** /echo/body/FreeFormObject/response_string | Test free form object |
| [**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 |
| [**testEchoBodyTagResponseString**](BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request body) |
@@ -72,6 +74,72 @@ No authorization required
| **200** | Successful operation | - |
## testEchoBodyFreeFormObjectResponseString
> String testEchoBodyFreeFormObjectResponseString(body)
Test free form object
Test free form object
### 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);
Object body = null; // Object | Free form object
try {
String result = apiInstance.testEchoBodyFreeFormObjectResponseString(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BodyApi#testEchoBodyFreeFormObjectResponseString");
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 |
|------------- | ------------- | ------------- | -------------|
| **body** | **Object**| Free form object | [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 | - |
## testEchoBodyPet
> Pet testEchoBodyPet(pet)
@@ -203,3 +271,69 @@ No authorization required
|-------------|-------------|------------------|
| **200** | Successful operation | - |
## testEchoBodyTagResponseString
> String testEchoBodyTagResponseString(tag)
Test empty json (request body)
Test empty json (request 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);
Tag tag = new Tag(); // Tag | Tag object
try {
String result = apiInstance.testEchoBodyTagResponseString(tag);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BodyApi#testEchoBodyTagResponseString");
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 |
|------------- | ------------- | ------------- | -------------|
| **tag** | [**Tag**](Tag.md)| Tag object | [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 | - |

View File

@@ -22,6 +22,7 @@ import org.openapitools.client.Pair;
import java.io.File;
import org.openapitools.client.model.Pet;
import org.openapitools.client.model.Tag;
import java.util.ArrayList;
@@ -120,6 +121,75 @@ public class BodyApi {
);
}
/**
* Test free form object
* Test free form object
* @param body Free form object (optional)
* @return String
* @throws ApiException if fails to make API call
*/
public String testEchoBodyFreeFormObjectResponseString(Object body) throws ApiException {
return this.testEchoBodyFreeFormObjectResponseString(body, Collections.emptyMap());
}
/**
* Test free form object
* Test free form object
* @param body Free form object (optional)
* @param additionalHeaders additionalHeaders for this call
* @return String
* @throws ApiException if fails to make API call
*/
public String testEchoBodyFreeFormObjectResponseString(Object body, Map<String, String> additionalHeaders) throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/echo/body/FreeFormObject/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>();
localVarHeaderParams.putAll(additionalHeaders);
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
);
}
/**
* Test body parameter(s)
* Test body parameter(s)
@@ -228,6 +298,75 @@ public class BodyApi {
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
);
}
/**
* Test empty json (request body)
* Test empty json (request body)
* @param tag Tag object (optional)
* @return String
* @throws ApiException if fails to make API call
*/
public String testEchoBodyTagResponseString(Tag tag) throws ApiException {
return this.testEchoBodyTagResponseString(tag, Collections.emptyMap());
}
/**
* Test empty json (request body)
* Test empty json (request body)
* @param tag Tag object (optional)
* @param additionalHeaders additionalHeaders for this call
* @return String
* @throws ApiException if fails to make API call
*/
public String testEchoBodyTagResponseString(Tag tag, Map<String, String> additionalHeaders) throws ApiException {
Object localVarPostBody = tag;
// create path and map variables
String localVarPath = "/echo/body/Tag/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>();
localVarHeaderParams.putAll(additionalHeaders);
final String[] localVarAccepts = {
"text/plain"
};

View File

@@ -349,6 +349,46 @@ paths:
- body
x-content-type: application/json
x-accepts: text/plain
/echo/body/Tag/response_string:
post:
description: Test empty json (request body)
operationId: test/echo/body/Tag/response_string
requestBody:
$ref: '#/components/requestBodies/Tag'
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test empty json (request body)
tags:
- body
x-content-type: application/json
x-accepts: text/plain
/echo/body/FreeFormObject/response_string:
post:
description: Test free form object
operationId: test/echo/body/FreeFormObject/response_string
requestBody:
content:
application/json:
schema:
type: object
description: Free form object
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test free form object
tags:
- body
x-content-type: application/json
x-accepts: text/plain
/binary/gif:
post:
description: Test binary (gif) response body
@@ -373,6 +413,12 @@ components:
schema:
$ref: '#/components/schemas/Pet'
description: Pet object that needs to be added to the store
Tag:
content:
application/json:
schema:
$ref: '#/components/schemas/Tag'
description: Tag object
schemas:
Category:
example:

View File

@@ -6,6 +6,7 @@ import org.openapitools.client.model.ApiResponse;
import java.io.File;
import org.openapitools.client.model.Pet;
import org.openapitools.client.model.Tag;
import java.util.ArrayList;
import java.util.HashMap;
@@ -42,6 +43,35 @@ public interface BodyApi extends ApiClient.Api {
/**
* Test free form object
* Test free form object
* @param body Free form object (optional)
* @return String
*/
@RequestLine("POST /echo/body/FreeFormObject/response_string")
@Headers({
"Content-Type: application/json",
"Accept: text/plain",
})
String testEchoBodyFreeFormObjectResponseString(Object body);
/**
* Test free form object
* Similar to <code>testEchoBodyFreeFormObjectResponseString</code> but it also returns the http response headers .
* Test free form object
* @param body Free form object (optional)
* @return A ApiResponse that wraps the response boyd and the http headers.
*/
@RequestLine("POST /echo/body/FreeFormObject/response_string")
@Headers({
"Content-Type: application/json",
"Accept: text/plain",
})
ApiResponse<String> testEchoBodyFreeFormObjectResponseStringWithHttpInfo(Object body);
/**
* Test body parameter(s)
* Test body parameter(s)
@@ -99,4 +129,33 @@ public interface BodyApi extends ApiClient.Api {
ApiResponse<String> testEchoBodyPetResponseStringWithHttpInfo(Pet pet);
/**
* Test empty json (request body)
* Test empty json (request body)
* @param tag Tag object (optional)
* @return String
*/
@RequestLine("POST /echo/body/Tag/response_string")
@Headers({
"Content-Type: application/json",
"Accept: text/plain",
})
String testEchoBodyTagResponseString(Tag tag);
/**
* Test empty json (request body)
* Similar to <code>testEchoBodyTagResponseString</code> but it also returns the http response headers .
* Test empty json (request body)
* @param tag Tag object (optional)
* @return A ApiResponse that wraps the response boyd and the http headers.
*/
@RequestLine("POST /echo/body/Tag/response_string")
@Headers({
"Content-Type: application/json",
"Accept: text/plain",
})
ApiResponse<String> testEchoBodyTagResponseStringWithHttpInfo(Tag tag);
}

View File

@@ -106,10 +106,14 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*BodyApi* | [**testBinaryGif**](docs/BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body
*BodyApi* | [**testBinaryGifWithHttpInfo**](docs/BodyApi.md#testBinaryGifWithHttpInfo) | **POST** /binary/gif | Test binary (gif) response body
*BodyApi* | [**testEchoBodyFreeFormObjectResponseString**](docs/BodyApi.md#testEchoBodyFreeFormObjectResponseString) | **POST** /echo/body/FreeFormObject/response_string | Test free form object
*BodyApi* | [**testEchoBodyFreeFormObjectResponseStringWithHttpInfo**](docs/BodyApi.md#testEchoBodyFreeFormObjectResponseStringWithHttpInfo) | **POST** /echo/body/FreeFormObject/response_string | Test free form object
*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
*BodyApi* | [**testEchoBodyTagResponseString**](docs/BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request body)
*BodyApi* | [**testEchoBodyTagResponseStringWithHttpInfo**](docs/BodyApi.md#testEchoBodyTagResponseStringWithHttpInfo) | **POST** /echo/body/Tag/response_string | Test empty json (request 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)

View File

@@ -349,6 +349,46 @@ paths:
- body
x-content-type: application/json
x-accepts: text/plain
/echo/body/Tag/response_string:
post:
description: Test empty json (request body)
operationId: test/echo/body/Tag/response_string
requestBody:
$ref: '#/components/requestBodies/Tag'
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test empty json (request body)
tags:
- body
x-content-type: application/json
x-accepts: text/plain
/echo/body/FreeFormObject/response_string:
post:
description: Test free form object
operationId: test/echo/body/FreeFormObject/response_string
requestBody:
content:
application/json:
schema:
type: object
description: Free form object
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test free form object
tags:
- body
x-content-type: application/json
x-accepts: text/plain
/binary/gif:
post:
description: Test binary (gif) response body
@@ -373,6 +413,12 @@ components:
schema:
$ref: '#/components/schemas/Pet'
description: Pet object that needs to be added to the store
Tag:
content:
application/json:
schema:
$ref: '#/components/schemas/Tag'
description: Tag object
schemas:
Category:
example:

View File

@@ -6,10 +6,14 @@ All URIs are relative to *http://localhost:3000*
|------------- | ------------- | -------------|
| [**testBinaryGif**](BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body |
| [**testBinaryGifWithHttpInfo**](BodyApi.md#testBinaryGifWithHttpInfo) | **POST** /binary/gif | Test binary (gif) response body |
| [**testEchoBodyFreeFormObjectResponseString**](BodyApi.md#testEchoBodyFreeFormObjectResponseString) | **POST** /echo/body/FreeFormObject/response_string | Test free form object |
| [**testEchoBodyFreeFormObjectResponseStringWithHttpInfo**](BodyApi.md#testEchoBodyFreeFormObjectResponseStringWithHttpInfo) | **POST** /echo/body/FreeFormObject/response_string | Test free form object |
| [**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 |
| [**testEchoBodyTagResponseString**](BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request body) |
| [**testEchoBodyTagResponseStringWithHttpInfo**](BodyApi.md#testEchoBodyTagResponseStringWithHttpInfo) | **POST** /echo/body/Tag/response_string | Test empty json (request body) |
@@ -139,6 +143,140 @@ No authorization required
| **200** | Successful operation | - |
## testEchoBodyFreeFormObjectResponseString
> String testEchoBodyFreeFormObjectResponseString(body)
Test free form object
Test free form object
### 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);
Object body = null; // Object | Free form object
try {
String result = apiInstance.testEchoBodyFreeFormObjectResponseString(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BodyApi#testEchoBodyFreeFormObjectResponseString");
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 |
|------------- | ------------- | ------------- | -------------|
| **body** | **Object**| Free form object | [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 | - |
## testEchoBodyFreeFormObjectResponseStringWithHttpInfo
> ApiResponse<String> testEchoBodyFreeFormObjectResponseString testEchoBodyFreeFormObjectResponseStringWithHttpInfo(body)
Test free form object
Test free form object
### 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);
Object body = null; // Object | Free form object
try {
ApiResponse<String> response = apiInstance.testEchoBodyFreeFormObjectResponseStringWithHttpInfo(body);
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#testEchoBodyFreeFormObjectResponseString");
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 |
|------------- | ------------- | ------------- | -------------|
| **body** | **Object**| Free form object | [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 | - |
## testEchoBodyPet
> Pet testEchoBodyPet(pet)
@@ -406,3 +544,137 @@ No authorization required
|-------------|-------------|------------------|
| **200** | Successful operation | - |
## testEchoBodyTagResponseString
> String testEchoBodyTagResponseString(tag)
Test empty json (request body)
Test empty json (request 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);
Tag tag = new Tag(); // Tag | Tag object
try {
String result = apiInstance.testEchoBodyTagResponseString(tag);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BodyApi#testEchoBodyTagResponseString");
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 |
|------------- | ------------- | ------------- | -------------|
| **tag** | [**Tag**](Tag.md)| Tag object | [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 | - |
## testEchoBodyTagResponseStringWithHttpInfo
> ApiResponse<String> testEchoBodyTagResponseString testEchoBodyTagResponseStringWithHttpInfo(tag)
Test empty json (request body)
Test empty json (request 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);
Tag tag = new Tag(); // Tag | Tag object
try {
ApiResponse<String> response = apiInstance.testEchoBodyTagResponseStringWithHttpInfo(tag);
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#testEchoBodyTagResponseString");
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 |
|------------- | ------------- | ------------- | -------------|
| **tag** | [**Tag**](Tag.md)| Tag object | [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 | - |

View File

@@ -19,6 +19,7 @@ import org.openapitools.client.Pair;
import java.io.File;
import org.openapitools.client.model.Pet;
import org.openapitools.client.model.Tag;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -147,6 +148,87 @@ public class BodyApi {
}
return localVarRequestBuilder;
}
/**
* Test free form object
* Test free form object
* @param body Free form object (optional)
* @return String
* @throws ApiException if fails to make API call
*/
public String testEchoBodyFreeFormObjectResponseString(Object body) throws ApiException {
ApiResponse<String> localVarResponse = testEchoBodyFreeFormObjectResponseStringWithHttpInfo(body);
return localVarResponse.getData();
}
/**
* Test free form object
* Test free form object
* @param body Free form object (optional)
* @return ApiResponse&lt;String&gt;
* @throws ApiException if fails to make API call
*/
public ApiResponse<String> testEchoBodyFreeFormObjectResponseStringWithHttpInfo(Object body) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = testEchoBodyFreeFormObjectResponseStringRequestBuilder(body);
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("testEchoBodyFreeFormObjectResponseString", 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 testEchoBodyFreeFormObjectResponseStringRequestBuilder(Object body) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/echo/body/FreeFormObject/response_string";
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Content-Type", "application/json");
localVarRequestBuilder.header("Accept", "text/plain");
try {
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
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 body parameter(s)
* Test body parameter(s)
@@ -301,4 +383,85 @@ public class BodyApi {
}
return localVarRequestBuilder;
}
/**
* Test empty json (request body)
* Test empty json (request body)
* @param tag Tag object (optional)
* @return String
* @throws ApiException if fails to make API call
*/
public String testEchoBodyTagResponseString(Tag tag) throws ApiException {
ApiResponse<String> localVarResponse = testEchoBodyTagResponseStringWithHttpInfo(tag);
return localVarResponse.getData();
}
/**
* Test empty json (request body)
* Test empty json (request body)
* @param tag Tag object (optional)
* @return ApiResponse&lt;String&gt;
* @throws ApiException if fails to make API call
*/
public ApiResponse<String> testEchoBodyTagResponseStringWithHttpInfo(Tag tag) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = testEchoBodyTagResponseStringRequestBuilder(tag);
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("testEchoBodyTagResponseString", 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 testEchoBodyTagResponseStringRequestBuilder(Tag tag) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/echo/body/Tag/response_string";
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Content-Type", "application/json");
localVarRequestBuilder.header("Accept", "text/plain");
try {
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(tag);
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;
}
}

View File

@@ -113,8 +113,10 @@ All URIs are relative to *http://localhost:3000*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*BodyApi* | [**testBinaryGif**](docs/BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body
*BodyApi* | [**testEchoBodyFreeFormObjectResponseString**](docs/BodyApi.md#testEchoBodyFreeFormObjectResponseString) | **POST** /echo/body/FreeFormObject/response_string | Test free form object
*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
*BodyApi* | [**testEchoBodyTagResponseString**](docs/BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request 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)

View File

@@ -349,6 +349,46 @@ paths:
- body
x-content-type: application/json
x-accepts: text/plain
/echo/body/Tag/response_string:
post:
description: Test empty json (request body)
operationId: test/echo/body/Tag/response_string
requestBody:
$ref: '#/components/requestBodies/Tag'
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test empty json (request body)
tags:
- body
x-content-type: application/json
x-accepts: text/plain
/echo/body/FreeFormObject/response_string:
post:
description: Test free form object
operationId: test/echo/body/FreeFormObject/response_string
requestBody:
content:
application/json:
schema:
type: object
description: Free form object
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test free form object
tags:
- body
x-content-type: application/json
x-accepts: text/plain
/binary/gif:
post:
description: Test binary (gif) response body
@@ -373,6 +413,12 @@ components:
schema:
$ref: '#/components/schemas/Pet'
description: Pet object that needs to be added to the store
Tag:
content:
application/json:
schema:
$ref: '#/components/schemas/Tag'
description: Tag object
schemas:
Category:
example:

View File

@@ -5,8 +5,10 @@ All URIs are relative to *http://localhost:3000*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**testBinaryGif**](BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body |
| [**testEchoBodyFreeFormObjectResponseString**](BodyApi.md#testEchoBodyFreeFormObjectResponseString) | **POST** /echo/body/FreeFormObject/response_string | Test free form object |
| [**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 |
| [**testEchoBodyTagResponseString**](BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request body) |
<a name="testBinaryGif"></a>
@@ -67,6 +69,68 @@ No authorization required
|-------------|-------------|------------------|
| **200** | Successful operation | - |
<a name="testEchoBodyFreeFormObjectResponseString"></a>
# **testEchoBodyFreeFormObjectResponseString**
> String testEchoBodyFreeFormObjectResponseString(body)
Test free form object
Test free form object
### 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);
Object body = null; // Object | Free form object
try {
String result = apiInstance.testEchoBodyFreeFormObjectResponseString(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BodyApi#testEchoBodyFreeFormObjectResponseString");
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 |
|------------- | ------------- | ------------- | -------------|
| **body** | **Object**| Free form object | [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 | - |
<a name="testEchoBodyPet"></a>
# **testEchoBodyPet**
> Pet testEchoBodyPet(pet)
@@ -191,3 +255,65 @@ No authorization required
|-------------|-------------|------------------|
| **200** | Successful operation | - |
<a name="testEchoBodyTagResponseString"></a>
# **testEchoBodyTagResponseString**
> String testEchoBodyTagResponseString(tag)
Test empty json (request body)
Test empty json (request 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);
Tag tag = new Tag(); // Tag | Tag object
try {
String result = apiInstance.testEchoBodyTagResponseString(tag);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BodyApi#testEchoBodyTagResponseString");
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 |
|------------- | ------------- | ------------- | -------------|
| **tag** | [**Tag**](Tag.md)| Tag object | [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 | - |

View File

@@ -29,6 +29,7 @@ import java.io.IOException;
import java.io.File;
import org.openapitools.client.model.Pet;
import org.openapitools.client.model.Tag;
import java.lang.reflect.Type;
import java.util.ArrayList;
@@ -187,6 +188,124 @@ public class BodyApi {
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for testEchoBodyFreeFormObjectResponseString
* @param body Free form object (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 testEchoBodyFreeFormObjectResponseStringCall(Object body, 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 = body;
// create path and map variables
String localVarPath = "/echo/body/FreeFormObject/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 testEchoBodyFreeFormObjectResponseStringValidateBeforeCall(Object body, final ApiCallback _callback) throws ApiException {
return testEchoBodyFreeFormObjectResponseStringCall(body, _callback);
}
/**
* Test free form object
* Test free form object
* @param body Free form object (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 testEchoBodyFreeFormObjectResponseString(Object body) throws ApiException {
ApiResponse<String> localVarResp = testEchoBodyFreeFormObjectResponseStringWithHttpInfo(body);
return localVarResp.getData();
}
/**
* Test free form object
* Test free form object
* @param body Free form object (optional)
* @return ApiResponse&lt;String&gt;
* @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> testEchoBodyFreeFormObjectResponseStringWithHttpInfo(Object body) throws ApiException {
okhttp3.Call localVarCall = testEchoBodyFreeFormObjectResponseStringValidateBeforeCall(body, null);
Type localVarReturnType = new TypeToken<String>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Test free form object (asynchronously)
* Test free form object
* @param body Free form object (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 testEchoBodyFreeFormObjectResponseStringAsync(Object body, final ApiCallback<String> _callback) throws ApiException {
okhttp3.Call localVarCall = testEchoBodyFreeFormObjectResponseStringValidateBeforeCall(body, _callback);
Type localVarReturnType = new TypeToken<String>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for testEchoBodyPet
* @param pet Pet object that needs to be added to the store (optional)
@@ -423,4 +542,122 @@ public class BodyApi {
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for testEchoBodyTagResponseString
* @param tag Tag object (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 testEchoBodyTagResponseStringCall(Tag tag, 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 = tag;
// create path and map variables
String localVarPath = "/echo/body/Tag/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 testEchoBodyTagResponseStringValidateBeforeCall(Tag tag, final ApiCallback _callback) throws ApiException {
return testEchoBodyTagResponseStringCall(tag, _callback);
}
/**
* Test empty json (request body)
* Test empty json (request body)
* @param tag Tag object (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 testEchoBodyTagResponseString(Tag tag) throws ApiException {
ApiResponse<String> localVarResp = testEchoBodyTagResponseStringWithHttpInfo(tag);
return localVarResp.getData();
}
/**
* Test empty json (request body)
* Test empty json (request body)
* @param tag Tag object (optional)
* @return ApiResponse&lt;String&gt;
* @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> testEchoBodyTagResponseStringWithHttpInfo(Tag tag) throws ApiException {
okhttp3.Call localVarCall = testEchoBodyTagResponseStringValidateBeforeCall(tag, null);
Type localVarReturnType = new TypeToken<String>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Test empty json (request body) (asynchronously)
* Test empty json (request body)
* @param tag Tag object (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 testEchoBodyTagResponseStringAsync(Tag tag, final ApiCallback<String> _callback) throws ApiException {
okhttp3.Call localVarCall = testEchoBodyTagResponseStringValidateBeforeCall(tag, _callback);
Type localVarReturnType = new TypeToken<String>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}