Skip to content

multpart/form-data single paramter cannot resolve in ui #1185

Closed
@ld000

Description

@ld000

Describe the bug
if define a method like this

@Operation(summary = "add")
    @PostMapping(value = "/add", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public ResponseEntity<CommonResultResponse> add(@Parameter(description = "content") @RequestPart(value = "content") String content) throws Exception {
        return ResponseHelper.success();
    }

in ui, the parameter content cannot resolve

image

but more than one parameter can resolve in ui

    @Operation(summary = "add")
    @PostMapping(value = "/add", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public ResponseEntity<CommonResultResponse> add(
                                         @Parameter(description = "content") @RequestPart(value = "content") String content,
                                                    @RequestPart(value = "type") String type
    ) throws Exception {
        return ResponseHelper.success();
    }

image

To Reproduce
Steps to reproduce the behavior:

  • What version of spring-boot you are using?
    2.3.8.RELEASE
  • What modules and versions of springdoc-openapi are you using?
<dependency>
        <groupId>org.springdoc</groupId>
        <artifactId>springdoc-openapi-ui</artifactId>
        <version>1.5.9</version>
</dependency>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ld000@bnasslahsen

        Issue actions

          multpart/form-data single paramter cannot resolve in ui · Issue #1185 · springdoc/springdoc-openapi