[Java RESTEasy client] updating test to use the Java RESTEasy echo api client (#17367) (#17470)

* updating test to use the Java RESTEasy echo api client (#17367)

* regenerated samples

* set source and target to 1.8 to fix workflow failure, adapted parser
This commit is contained in:
Milad
2023-12-26 02:32:51 +01:00
committed by GitHub
parent a67e07e132
commit 8c014372aa
275 changed files with 9144 additions and 19842 deletions

View File

@@ -123,6 +123,7 @@ Class | Method | HTTP request | Description
*BodyApi* | [**testBinaryGif**](docs/BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body
*BodyApi* | [**testBodyApplicationOctetstreamBinary**](docs/BodyApi.md#testBodyApplicationOctetstreamBinary) | **POST** /body/application/octetstream/binary | Test body parameter(s)
*BodyApi* | [**testBodyMultipartFormdataArrayOfBinary**](docs/BodyApi.md#testBodyMultipartFormdataArrayOfBinary) | **POST** /body/application/octetstream/array_of_binary | Test array of binary in multipart mime
*BodyApi* | [**testBodyMultipartFormdataSingleBinary**](docs/BodyApi.md#testBodyMultipartFormdataSingleBinary) | **POST** /body/application/octetstream/single_binary | Test single binary in multipart mime
*BodyApi* | [**testEchoBodyAllOfPet**](docs/BodyApi.md#testEchoBodyAllOfPet) | **POST** /echo/body/allOf/Pet | Test body parameter(s)
*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)

View File

@@ -513,6 +513,27 @@ paths:
tags:
- body
x-accepts: image/gif
/body/application/octetstream/single_binary:
post:
description: Test single binary in multipart mime
operationId: test/body/multipart/formdata/single_binary
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/test_body_multipart_formdata_single_binary_request'
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test single binary in multipart mime
tags:
- body
x-content-type: multipart/form-data
x-accepts: text/plain
/body/application/octetstream/array_of_binary:
post:
description: Test array of binary in multipart mime
@@ -825,6 +846,12 @@ components:
allOf:
- $ref: '#/components/schemas/Bird'
- $ref: '#/components/schemas/Category'
test_body_multipart_formdata_single_binary_request:
properties:
my-file:
format: binary
type: string
type: object
test_body_multipart_formdata_array_of_binary_request:
properties:
files:

View File

@@ -7,6 +7,7 @@ All URIs are relative to *http://localhost:3000*
| [**testBinaryGif**](BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body |
| [**testBodyApplicationOctetstreamBinary**](BodyApi.md#testBodyApplicationOctetstreamBinary) | **POST** /body/application/octetstream/binary | Test body parameter(s) |
| [**testBodyMultipartFormdataArrayOfBinary**](BodyApi.md#testBodyMultipartFormdataArrayOfBinary) | **POST** /body/application/octetstream/array_of_binary | Test array of binary in multipart mime |
| [**testBodyMultipartFormdataSingleBinary**](BodyApi.md#testBodyMultipartFormdataSingleBinary) | **POST** /body/application/octetstream/single_binary | Test single binary in multipart mime |
| [**testEchoBodyAllOfPet**](BodyApi.md#testEchoBodyAllOfPet) | **POST** /echo/body/allOf/Pet | Test body parameter(s) |
| [**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) |
@@ -196,6 +197,68 @@ No authorization required
|-------------|-------------|------------------|
| **200** | Successful operation | - |
<a id="testBodyMultipartFormdataSingleBinary"></a>
# **testBodyMultipartFormdataSingleBinary**
> String testBodyMultipartFormdataSingleBinary(myFile)
Test single binary in multipart mime
Test single binary in multipart mime
### 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);
File myFile = new File("/path/to/file"); // File |
try {
String result = apiInstance.testBodyMultipartFormdataSingleBinary(myFile);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BodyApi#testBodyMultipartFormdataSingleBinary");
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 |
|------------- | ------------- | ------------- | -------------|
| **myFile** | **File**| | [optional] |
### Return type
**String**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Successful operation | - |
<a id="testEchoBodyAllOfPet"></a>
# **testEchoBodyAllOfPet**
> Pet testEchoBodyAllOfPet(pet)

View File

@@ -432,6 +432,128 @@ public class BodyApi {
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for testBodyMultipartFormdataSingleBinary
* @param myFile (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 testBodyMultipartFormdataSingleBinaryCall(File myFile, 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 = "/body/application/octetstream/single_binary";
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 (myFile != null) {
localVarFormParams.put("my-file", myFile);
}
final String[] localVarAccepts = {
"text/plain"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"multipart/form-data"
};
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 testBodyMultipartFormdataSingleBinaryValidateBeforeCall(File myFile, final ApiCallback _callback) throws ApiException {
return testBodyMultipartFormdataSingleBinaryCall(myFile, _callback);
}
/**
* Test single binary in multipart mime
* Test single binary in multipart mime
* @param myFile (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 testBodyMultipartFormdataSingleBinary(File myFile) throws ApiException {
ApiResponse<String> localVarResp = testBodyMultipartFormdataSingleBinaryWithHttpInfo(myFile);
return localVarResp.getData();
}
/**
* Test single binary in multipart mime
* Test single binary in multipart mime
* @param myFile (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> testBodyMultipartFormdataSingleBinaryWithHttpInfo(File myFile) throws ApiException {
okhttp3.Call localVarCall = testBodyMultipartFormdataSingleBinaryValidateBeforeCall(myFile, null);
Type localVarReturnType = new TypeToken<String>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Test single binary in multipart mime (asynchronously)
* Test single binary in multipart mime
* @param myFile (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 testBodyMultipartFormdataSingleBinaryAsync(File myFile, final ApiCallback<String> _callback) throws ApiException {
okhttp3.Call localVarCall = testBodyMultipartFormdataSingleBinaryValidateBeforeCall(myFile, _callback);
Type localVarReturnType = new TypeToken<String>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for testEchoBodyAllOfPet
* @param pet Pet object that needs to be added to the store (optional)