feign-form
feign-form copied to clipboard
Scenario with multiple file in array.
In such situation the field name of multipart is always same, but files in the sending payload are more than one. Using standard HashMap causes, that it's impossible to send more files on same field name. I propose to use here MultiValueMap.
My defined API in spring is:
@PostMapping(
path = "/send-documents",
consumes = MediaType.MULTIPART_FORM_DATA_VALUE
)
ResponseResult sendDocuments(
@RequestPart(name = "documents") MultipartFile[] documents);
When I create feign client with this and put more than one multipart files, I get only one document (last added). MultipartFile contains name (which is used as a field name - here documents) and originalName, which is the original name of the file. If I use another name, than documents, than spring controller doesn't get such element in the table (what's rather expected behavior).
Any updates on this pull request? It seems that we still have to manually copy and paste the changes into our projects.
No. The newest version of the openfeign fixes the problem.
pt., 30 cze 2023 o 10:06 Юрий @.***> napisał(a):
Any updates on this pull request? It seems that we still have to manually copy and paste the changes into our projects.
— Reply to this email directly, view it on GitHub https://github.com/OpenFeign/feign-form/pull/97#issuecomment-1614288582, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQULHWOFAMFR42VGI6FG6TXN2CJFANCNFSM4TIQIJXA . You are receiving this because you authored the thread.Message ID: @.***>