Skip to content

Commit 76c2122

Browse files
authored
Merge pull request #47 from phxism/master
fix annotation for file upload api
2 parents 74a462e + 54307a3 commit 76c2122

File tree

1 file changed

+2
-2
lines changed
  • springdoc-openapi-spring-boot-2-webmvc/src/main/java/org/springdoc/demo/app2/api

1 file changed

+2
-2
lines changed

springdoc-openapi-spring-boot-2-webmvc/src/main/java/org/springdoc/demo/app2/api/PetApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ default ResponseEntity<Void> updatePetWithForm(
161161
@ApiResponses(value = {
162162
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = ModelApiResponse.class))) })
163163
@PostMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = {
164-
"application/octet-stream" })
164+
"multipart/form-data" })
165165
default ResponseEntity<ModelApiResponse> uploadFile(
166166
@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
167167
@Parameter(description = "Additional Metadata") @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata,
168-
@io.swagger.v3.oas.annotations.parameters.RequestBody(content = @Content(mediaType = "application/octet-stream", schema = @Schema(type = "string", format = "binary"))) @Valid @RequestPart("file") MultipartFile file) {
168+
@Parameter(content = @Content(mediaType = "multipart/form-data", schema = @Schema(type = "string", format = "binary"))) @Valid @RequestPart("file") MultipartFile file) {
169169
return getDelegate().uploadFile(petId, additionalMetadata, file);
170170
}
171171

0 commit comments

Comments
 (0)