WebFlux Multipart File Upload - not possible to use FilePart in Swagger Version: 3.23.11
See original GitHub issueFor an endpoint using Spring WebFlux to upload a file, the Swagger UI documentation is not generating properly the File Input Button. It doesn’t allow to choose a file and send it as a multipart request for FilePart:

Controller
public String upload(
@RequestPart(value = "uploadedBy", required = true) String uploadedBy,
@RequestPart(value = "file",required = false) FilePart file)
{
.....
}
Swagger Version: 3.23.11 Below are the Swagger Maven dependencies.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-bean-validators</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-spring-webflux</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
API Doc Json :
"paths": {
"/upload": {
"post": {
"tags": [
"document-controller"
],
"summary": "uploadDocument",
"operationId": "uploadDocumentUsingPOST",
"consumes": [
"multipart/form-data"
],
"produces": [
"*/*"
],
"parameters": [
{
"in": "formData",
"name": "file",
"description": "file",
"required": false,
"schema": {
"$ref": "#/definitions/FilePart"
}
},
{
"name": "uploadedBy",
"in": "formData",
"description": "uploadedBy",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "OK"
},
"201": {
"description": "Created"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
"description": "Not Found"
}
},
"deprecated": false
}
}
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:8 (1 by maintainers)
Top Results From Across the Web
WebFlux Multipart File Upload - not possible to use FilePart in ...
For an endpoint using Spring WebFlux to upload a file, the Swagger UI documentation is not generating properly the File Input Button.
Read more >weixin_39881859的博客_CSDN博客-领域博主
服务器的虚拟盘符,服务器虚拟内存更改盘符,虚拟服务器的定义,虚拟主机和服务器有什么区别,两者的概念及定义,ajax 请求豆瓣ipa,AJAX各种请求.
Read more >WebFlux Multipart File Upload - not possible to...anycodings
For an endpoint using Spring WebFlux to programming upload a file, the Swagger UI documentation Learning is not generating properly the File ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

in the meantime, you can do this:
Had the same issue and followed this guide: https://stackoverflow.com/questions/63275134/springfox-swagger-ui-3-0-0-does-not-bring-up-swagger-ui-html-page
@RequestPart(“file”) instead of @RequestParam(“file”) did the trick.