Skip to content

Content-type for POST endpoints with multipart/form-data does not work since v2.4.0  #2621

Closed
@maxdobler

Description

@maxdobler

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 or 2.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:
image

Swagger UI in v2.3.0
Screenshot 2024-06-12 at 18 13 45

Swagger UI in 2.4.0 / 2.5.0
Screenshot 2024-06-12 at 18 14 50

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions