[Java][Native] Fix multipart builder files array (#16055) (#16094)

* [Java] Fixed bug in native client generation when API accepts array of files (#16055)

* Adding test for java native client

* Updated samples
This commit is contained in:
Luca
2023-07-24 09:57:21 +02:00
committed by GitHub
parent 0a02860b50
commit 584f8448ee
20 changed files with 1028 additions and 1 deletions

View File

@@ -6,6 +6,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 |
| [**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 |
@@ -141,6 +142,72 @@ No authorization required
| **200** | Successful operation | - |
## testBodyMultipartFormdataArrayOfBinary
> String testBodyMultipartFormdataArrayOfBinary(files)
Test array of binary in multipart mime
Test array of 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);
List<File> files = Arrays.asList(); // List<File> |
try {
String result = apiInstance.testBodyMultipartFormdataArrayOfBinary(files);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BodyApi#testBodyMultipartFormdataArrayOfBinary");
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 |
|------------- | ------------- | ------------- | -------------|
| **files** | **List&lt;File&gt;**| | |
### 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 | - |
## testEchoBodyFreeFormObjectResponseString
> String testEchoBodyFreeFormObjectResponseString(body)