[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

@@ -427,6 +427,27 @@ paths:
tags:
- body
x-accepts: image/gif
/body/application/octetstream/array_of_binary:
post:
description: Test array of binary in multipart mime
operationId: test/body/multipart/formdata/array_of_binary
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/test_body_multipart_formdata_array_of_binary_request'
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test array of binary in multipart mime
tags:
- body
x-content-type: multipart/form-data
x-accepts: text/plain
components:
requestBodies:
Pet:
@@ -657,4 +678,14 @@ components:
allOf:
- $ref: '#/components/schemas/Bird'
- $ref: '#/components/schemas/Category'
test_body_multipart_formdata_array_of_binary_request:
properties:
files:
items:
format: binary
type: string
type: array
required:
- files
type: object

View File

@@ -72,6 +72,35 @@ public interface BodyApi extends ApiClient.Api {
/**
* Test array of binary in multipart mime
* Test array of binary in multipart mime
* @param files (required)
* @return String
*/
@RequestLine("POST /body/application/octetstream/array_of_binary")
@Headers({
"Content-Type: multipart/form-data",
"Accept: text/plain",
})
String testBodyMultipartFormdataArrayOfBinary(@Param("files") List<File> files);
/**
* Test array of binary in multipart mime
* Similar to <code>testBodyMultipartFormdataArrayOfBinary</code> but it also returns the http response headers .
* Test array of binary in multipart mime
* @param files (required)
* @return A ApiResponse that wraps the response boyd and the http headers.
*/
@RequestLine("POST /body/application/octetstream/array_of_binary")
@Headers({
"Content-Type: multipart/form-data",
"Accept: text/plain",
})
ApiResponse<String> testBodyMultipartFormdataArrayOfBinaryWithHttpInfo(@Param("files") List<File> files);
/**
* Test free form object
* Test free form object