'Springdoc - Swagger UI having an array of objects with Multipart in form-data

I am having trouble setting up the swagger UI for a specific endpoint. I am having a form-data that has to fill up an array of Objects that may include MultipartFile. Till now I can represent as form-data only a single object of this type but when I request a List of these objects, swagger automatically converts it to application/json.

For example,

public class DocumentRequest implements Serializable {
private String documentNumber;
private Long documentType;
private MultipartFile attachedFile;
}

When i have this on my controller all seems good

@Parameter(description = "body", required = true) @Valid @ModelAttribute DocumentRequest  adapter

Works:

works

but when i have a List of these items it doesn't work as expected

@Parameter(description = "body", required = true) @Valid @ModelAttribute List<DocumentRequest> adapter

Does not work:

enter image description here

Any thoughts?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source