Forum Discussion
xbentu
5 years agoNew Contributor
I finally found the solution after 3 weeks of swapping Annotation combinations.
@Parameter(schema = @Schema(name = "file", type = "string", format = "binary"))
This is needed for the InputStream @FormDataParam annotation.
@POST
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
@Path("/upload")
@Operation(
summary = "summary",
description = "description"
responses = {@ApiResponse(
responseCode = "200",
description = "OK"
)}
)
public Response uploadFile(
@Parameter(name = "file", type = "string", format = "binary")
@FormDataParam("file") InputStream inputStream,
@FormDataParam("file") FormDataContentDisposition fileDetail
)throws RestException{
//process file code
}
Related Content
- 3 years ago
Recent Discussions
- 7 days ago
- 7 days ago
- 24 days ago