I have an API where I need to support multiple file uplaods. This I need to make it part of the API documenation. I choose Body and Form data as the Request Params. So for the files, I selected the type as file but did not find multiple as option. Could you please guide me as where exactly this is ? For your information, the following is the API end point
@RequestMapping
(
value=“events”,
method = RequestMethod.POST,
consumes={MediaType.MULTIPART_FORM_DATA_VALUE},
produces = {“application/json”}
)
public ResponseEntity SamplePostRequest
(
@RequestParam(name=“files”, required=false) MultipartFile files,
@RequestParam(name=“input_info”, required=true) String strInput,
@RequestParam(name=“app_id”, required=true) String strAppId
)
Hello, in Body → form-data, add the parameter name, select the type as file, and then upload multiple files.
Does this support single file or multiple files ? I mean array of files.
“requestBody”: {
“content”: {
“multipart/form-data”: {
“schema”: {
“type”: “object”,
“properties”: {
“files”: {
“format”: “binary”,
“type”: “string”,
“description”: “Attach relevant media here, which includes, jpg, mp3, pdf, mp4 files. More than one media can be selected”,
“example”: [
“”
]
},
This is the openapi.json which is getting generated when I use export in the settings. Nowhere it is indicated here that it is going accept an array of files. Am I missing anything here ?
According to 3.0.1 spec: this is how it should be:
requestBody:
content:
multipart/form-data:
schema:
properties:
# The property name ‘file’ will be used for all files.
files:
type: array
items:
type: string
format: binary
You can try selecting Body → form-data, add the param name, set the data type to array, then click into Advanced Settings → JSON Schema and fill in the editor:

This does not work. Tried, but when you save it the format thing vanishes.
Basically it looks like a bug. I had to manually make changes in order to generate my SDKs using openapi. It then started working. Request you to fix this and release a patch.
Hello, based on the Spring code you provided, I’ve verified in Apidog that it supports uploading multiple files through a single parameter, and it works correctly.
I tried generating the SDKs using the openapi tools for supporting the multiple files. It would not work. It worked only for single file. I am actually talking about the export to openapi spec. As you mentioned this may work on apidog.
Thank you for your detailed feedback! Regarding the issues you mentioned, I’d like to confirm a few points with you:
- Verify if the JSON Schema method can generate correct export results
As mentioned earlier, manually filling in the JSON Schema and then exporting - does the exported file meet expectations?
Please provide a screenshot or paste the content of the “files” section in the exported spec, so we can confirm if the export result meets expectations. - About the format disappearing after saving
You mentioned “when you save it the format thing vanishes”, which we haven’t been able to reproduce temporarily.
Could you please provide the following information: comparison screenshots of the JSON Schema editor before saving and after reopening the interface?
This will help us better identify the problem.
- Regarding your manual modification of the exported file
You mentioned that after manually modifying the exported OpenAPI spec, the SDK generation could properly support multiple file uploads. Could you share the spec snippets (the “files” field section) before and after your modifications? This will help us identify the correct format that needs to be generated during export.
