#902 already adresses this issue, but since master/5.0.0-beta now already should support OpenAPI 3.0 standard, it is time for a bug report.
There is no support for multiple file upload via e.g. List<IFormFile>, swagger simply posts
Content-Disposition: form-data; name="files"
[object File],[object File]
-----------------------------217261477111538
instead of properly resolving the file objects to multiple files. The ui is fine tho.
See:
Correct request would look like this
Content-Disposition: form-data; name="files"; filename="file.txt"
<context>
-----------------------------217261477111538
Content-Disposition: form-data; name="files"; filename="file.txt"
<context>
-----------------------------217261477111538
I am investigating this now
This an open issue with the swagger-ui:
https://github.com/swagger-api/swagger-ui/issues/4600
It may “look” fine but it’s the UI that submits the request and it’s doing so incorrectly. It’s not sending as multiple parts.
I've run into the same issue
I can confirm this is still an issue on the latest RC version (5) with .NET Core 3.1.
As mentioned above, this is an open issue with the swagger-ui and is not specific to Swashbuckle. It won't be resolved in Swashbuckle until it's resolved in the upstream swagger-ui library.
The swagger-ui issue should be fixed in its latest release releases/tag/v3.26.0
Bug Fixes
- OAS3 upload file when array items are type=string format=binary (#6040)
Will include latest version of swagger-ui with next SB release.
See commit 3e87212fab8c10441b592ae81fc263b1ab631acf
Most helpful comment
I can confirm this is still an issue on the latest RC version (5) with .NET Core 3.1.