Skip to content

Multiple file upload Flux<FilePart> error on the swagger-ui #678

Closed
@oursy

Description

@oursy

Given the following endpoint:

  @PostMapping(value = "/files", produces = {MediaType.APPLICATION_JSON_VALUE}, consumes = {MediaType.MULTIPART_FORM_DATA_VALUE})
    @Operation(summary = "files")
    public Flux<Void> handleFileUpload(
            @RequestPart("files") @Parameter(description = "files",
                    content = @Content(mediaType = MediaType.APPLICATION_OCTET_STREAM_VALUE))
                    Flux<FilePart> filePartFux) throws IOException {
        File tmp = File.createTempFile("tmp", "");
        return filePartFux.flatMap(filePart -> {
            Path path = Paths.get(tmp.toString() + filePart.filename());
            System.out.println(path);
            return filePart.transferTo(path);
        });
    }

Calling with swaggee-ui returns failure

image

I am using springdoc 1.3.9 & spring boot 2.3.0

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