MediaType Multipart/Form-data support in Swagger-UI?

33 views Asked by At

I am Using Dropwizard version 3.0.0 and below dependency for Swagger annotaions and Smokerturner for swagger-UI

        <dependency>
            <groupId>com.smoketurner</groupId>
            <artifactId>dropwizard-swagger</artifactId>
            <version>3.0.0-1</version>
        </dependency>
        <dependency>
            <groupId>io.swagger.core.v3</groupId>
            <artifactId>swagger-annotations-jakarta</artifactId>
            <version>2.2.9</version>

        </dependency>

I have below Rest API

    @POST
    @Consumes(MediaType.MULTIPART_FORM_DATA)
    @Operation(tags = {"bulkApi"}, summary = "Upload CSV to create employee in Bulk", description = "Upload CSV to create employee in Bulk")
    @ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "Success",
                    content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))),
            @ApiResponse(responseCode = "401", description = "Invalid Credentials Provided",
                    content = @Content(mediaType = "text/plain"))
    })
    public List<Employee> uploadBulk(@FormDataParam("file") InputStream uploadInputStream,@FormDataParam("file") FormDataContentDisposition fileDetails) {

        return employeeService.create(uploadInputStream);
    }

But on swagger-UI I am not able to see any upload/Select button to upload a file. Can any one help me on this

0

There are 0 answers