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>

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

    Issue actions