[Kotlin Spring] fix template request part and description (#17821)

* [kotlin-spring] Parameter Name and Description are now used properly in multipart form endpoints

* [kotlin-spring] Parameter Name and Description are now used properly in multipart form endpoints (generated docs and samples)

* [kotlin-spring] Parameter Name and Description are now used properly in multipart form endpoints (generated docs and samples)

---------

Co-authored-by: Kevin Hahn <kevin.hahn@partner.ionity.eu>
This commit is contained in:
hahny93
2024-03-09 10:43:27 +01:00
committed by GitHub
parent 494fc7d182
commit 033993c63d
14 changed files with 782 additions and 12 deletions

View File

@@ -172,7 +172,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
produces = ["application/json"],
consumes = ["multipart/form-data"]
)
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file detail") @Valid @RequestPart("file") file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
}
}