I am using Openapi V3 with Maven plugin openapi-generator-maven-plugin (5.3.0) for multiple files upload with multipart/form-data. However, the interface code generated is incomplete - missing List declaration in one of the default method (One method declares input parameter as List<MultipartFile> file
and the other method declares it as MultipartFile file
):
default ResponseEntity<UploadDocumentsResponse> _uploadDocuments(@Valid @RequestPart(value = "file", required = false) List<MultipartFile> file) {
return uploadDocuments(authorization, file);
}
// Override this method
default ResponseEntity<UploadDocumentsResponse> uploadDocuments(MultipartFile file) {
...
}
Here is the spec:
/api/uploadDocuments:
post:
tags:
- documents
summary: Upload documents
description: Upload documents
operationId: uploadDocuments
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
file:
type: array
items:
type: string
format: binary