Comments (10)
I'm guessing this is not the right place to ask questions about springfox?? Every-time I ask questions I get answers from you which do not make sense.
What does this mean "Swagger-ui does not support multipart file upload"?? Springfox is build on swagger and example you posted for sprinfox here https://github.com/springfox/springfox-demos/blob/be4118bb031c8dcded514c33d74cae52fc51ff08/boot-swagger/src/main/java/springfoxdemo/boot/swagger/web/FileUploadController.java is for Multipart file upload.
I asked a simple question and I keep getting ridiculous answer.
from springfox-demos.
Thanks Dilip
FileUploadController.java actually works, but its just that when we change @RequestPart String description
to @RequestPart RequestObject requestObject
it produces following error org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/octet-stream' not supported
so does this means that it is partially supported?
from springfox-demos.
Swagger-ui does not support multipart file upload
from springfox-demos.
I am also facing similar problem with https://github.com/springfox/springfox-demos/blob/be4118bb031c8dcded514c33d74cae52fc51ff08/boot-swagger/src/main/java/springfoxdemo/boot/swagger/web/FileUploadController.java
When I modify @RequestPart String description
to @RequestPart RequestObject requestObject
I am getting error
org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/octet-stream' not supported
Even the curl generated by swagger-ui produces same error, but once I add type=application/json to body problem is fixed
curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' -F 'requestObject=@/req.json;type=application/json' 'http://localhost:8080/MyService/api/upload'
looking at swagger-api/swagger-core#636, it looks like swagger-ui have support to provide content-type for RequestPart.
springfox version 2.7.0
springboot Version 1.5.4.RELEASE
from springfox-demos.
Request parts, and multipart requests in general are not supported by swagger-ui. Atleast as of version 2.0 of the spec.
from springfox-demos.
Hi Dilip,
I am confused here, isn't FileUploadController.java multipart request with two request parts ?
from springfox-demos.
It is but swagger-ui and OpenAPI spec in general doesnt support multipart requests well. FileUploadController
is just to demonstrate that springfox tries to generate the right description
from springfox-demos.
Dilip / Nitesh, any update on this issue.
I'm also facing the same issue. When i change @RequestPart String to @RequestPart Object, i'm getting the error.
from springfox-demos.
Multipart requests are not supported very well in Swagger-ui unfortunately
from springfox-demos.
"Multipart requests are not supported very well in Swagger-ui unfortunately"
then for file upload instead of multipart file which data type can we use?
from springfox-demos.
Related Issues (20)
- ERROR : [RMI TCP Connection(3)-127.0.0.1] [springfox.documentation.spring.web.scanners.ApiDescriptionReader] H=[LT031HLB] Skipping process path[/xx/yy/zzzz], method[xxMethod] as it has an error. HOT 1
- full class name as schema name,
- @Schema can not show
- I am not able to get the headers hooked up and working
- Upgrading from 2.9.2 to 3.0.0 removed access to /swagger-ui.html HOT 1
- How to use ApiListingScannerPlugin to add a web api? Could you offer a demo with version 3.0?
- Swagger UI not showing HOT 1
- Webflux example project is outdated
- Request Body parameter - providing different json examples to the end user in swagger (same object in multiple endpoints)
- Avoid endless Class Parameter Argument scanning, if the parameter Object contains a circular reference (e.g. bi directional relation within a bean)
- [Question] Change /api-docs URL using springfox-boot-starter:3.0.0
- Is it possible to share sample app for spring fox 2.9.2
- Moving /v2/api-docs to customised path
- What ever i try, the /v2/api-docs and /swagger-resources/configuration/ui return a 404 NOT FOUND
- documentationPluginsBootstrapper error in spring fox
- How to define security at root level HOT 1
- Skipping process path[<path>], method[<method>] as it has an error.
- http://localhost:8080/spring-xml-swagger/swagger-ui.html is not working HOT 3
- Questions :: Is there a way in Swagger to show the UI documentation only to internal users? HOT 3
- Cant reach "http://localhost:8080/documentation/swagger-ui" when running the springfox-demos/boot-webflux/ demo HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from springfox-demos.