-
-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content-type for POST endpoints with multipart/form-data does not work since v2.4.0 #2621
Comments
Not reproducible. This ticket will be closed, but can be reopened if your provide the reproducible sample. |
I created an example to reproduce the bug: /~https://github.com/maxdobler/springdoc-example I noticed that it makes a difference if the If you change the springdoc version to Please reopen this issue. |
@bnasslahsen Please reopen this issue |
This behavior was a bug in previous versions. In version 2.5.0, the workaround is to explicitly declare @Operation(summary = "Upload new content", description = "Upload test content")
@PostMapping(produces = APPLICATION_JSON_VALUE, consumes = MULTIPART_FORM_DATA_VALUE)
HelloDto uploadContent(@RequestBody HelloUploadDto contentUploadDto) throws IOException; |
Oh I see, thank you for the fast Feedback. It now works with |
Describe the bug
Sind version 2.4.0 POST Endpoints with content-type
multipart/form-data
are not generated properly in open api spec. This leads to missing content-type in swagger ui webpage.To Reproduce
Steps to reproduce the behavior:
What version of spring-boot you are using?
3.3.0
What modules and versions of springdoc-openapi are you using?
springdoc-openapi-starter-webmvc-ui:2.4.0
What is the actual and the expected result using OpenAPI Description (yml or json)?
Provide with a sample code (HelloController) or Test that reproduces the problem
POST Endpoint which accepts multipart/form-data. Use [sprin](springdoc-openapi-starter-webmvc-ui in version
2.4.0
or2.5.0
@PostMapping(produces = APPLICATION_JSON_VALUE, consumes = MULTIPART_FORM_DATA_VALUE)
Go to swagger-ui webpage and the content-type is missing for the POST Endpoint.
Expected behavior
Adds content-type multipart/form-data to POST Endpoints in OpenApi docs
Screenshots
Open Api Diff:
Swagger UI in v2.3.0
Swagger UI in 2.4.0 / 2.5.0
Additional context
The text was updated successfully, but these errors were encountered: