mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 20:50:55 +00:00
[kotlin-spring] Generate @Valid annotation on all RequestParts/Params for Multipart requests when useBeanValidation=true (#20864)
* [kotlin-spring] Generate @Valid annotation on all RequestParts/Params for Multipart requests when useBeanValidation=true * [kotlin-spring] Fix failing test The test was failing because of the newly added @Valid and an assert which is not correct anymore.
This commit is contained in:
parent
73b6b7084f
commit
08ec37cc10
@ -1 +1 @@
|
||||
{{#isFormParam}}{{^isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]{{^isContainer}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/isContainer}}){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}{{^isContainer}}, schema = Schema(defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}){{/isContainer}}{{/defaultValue}}{{/allowableValues}}){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/swagger1AnnotationLibrary}} {{#isModel}}@RequestPart{{/isModel}}{{^isModel}}@RequestParam{{/isModel}}(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}} {{/isFile}}{{#isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "file detail"){{/swagger1AnnotationLibrary}} {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart("{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}}{{/isFile}}{{/isFormParam}}
|
||||
{{#isFormParam}}{{^isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]{{^isContainer}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/isContainer}}){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}{{^isContainer}}, schema = Schema(defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}){{/isContainer}}{{/defaultValue}}{{/allowableValues}}){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/swagger1AnnotationLibrary}} {{#useBeanValidation}}@Valid{{/useBeanValidation}} {{#isModel}}@RequestPart{{/isModel}}{{^isModel}}@RequestParam{{/isModel}}(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}} {{/isFile}}{{#isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "file detail"){{/swagger1AnnotationLibrary}} {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart("{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}}{{/isFile}}{{/isFormParam}}
|
@ -845,7 +845,7 @@ public class KotlinSpringServerCodegenTest {
|
||||
Path outputFilepath = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PetApiController.kt");
|
||||
|
||||
assertFileContains(outputFilepath,
|
||||
"@Parameter(description = \"Additional data to pass to server\") @RequestParam(value = \"additionalMetadata\", required = false) additionalMetadata: kotlin.String?");
|
||||
"@Parameter(description = \"Additional data to pass to server\") @Valid @RequestParam(value = \"additionalMetadata\", required = false) additionalMetadata: kotlin.String?");
|
||||
assertFileContains(outputFilepath,
|
||||
"@Parameter(description = \"image to upload\") @Valid @RequestPart(\"image\", required = false) image: org.springframework.web.multipart.MultipartFile");
|
||||
|
||||
|
@ -99,7 +99,7 @@ interface PetApi {
|
||||
value = ["/pet/{petId}"],
|
||||
consumes = ["application/x-www-form-urlencoded"]
|
||||
)
|
||||
fun updatePetWithForm( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "name", required = false) name: kotlin.String? , @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
fun updatePetWithForm( @PathVariable("petId") petId: kotlin.Long, @Valid @RequestParam(value = "name", required = false) name: kotlin.String? , @Valid @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ interface PetApi {
|
||||
produces = ["application/json"],
|
||||
consumes = ["multipart/form-data"]
|
||||
)
|
||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @Valid @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ class PetApiController() {
|
||||
value = ["/pet/{petId}"],
|
||||
consumes = ["application/x-www-form-urlencoded"]
|
||||
)
|
||||
fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ class PetApiController() {
|
||||
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 to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): 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") @Valid @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/{petId}"],
|
||||
consumes = ["application/x-www-form-urlencoded"]
|
||||
)
|
||||
fun updatePetWithForm( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "name", required = false) name: kotlin.String? , @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
fun updatePetWithForm( @PathVariable("petId") petId: kotlin.Long, @Valid @RequestParam(value = "name", required = false) name: kotlin.String? , @Valid @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.valueOf(405))
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
produces = ["application/json"],
|
||||
consumes = ["multipart/form-data"]
|
||||
)
|
||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @Valid @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||
}
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ interface PetApi {
|
||||
value = ["/pet/{petId}"],
|
||||
consumes = ["application/x-www-form-urlencoded"]
|
||||
)
|
||||
fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
return getDelegate().updatePetWithForm(petId, name, status)
|
||||
}
|
||||
|
||||
@ -199,7 +199,7 @@ interface PetApi {
|
||||
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 to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): 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") @Valid @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
return getDelegate().uploadFile(petId, additionalMetadata, file)
|
||||
}
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ interface PetApi {
|
||||
value = ["/pet/{petId}"],
|
||||
consumes = ["application/x-www-form-urlencoded"]
|
||||
)
|
||||
fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
return getDelegate().updatePetWithForm(petId, name, status)
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ interface PetApi {
|
||||
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 to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): 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") @Valid @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
return getDelegate().uploadFile(petId, additionalMetadata, file)
|
||||
}
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/{petId}"],
|
||||
consumes = ["application/x-www-form-urlencoded"]
|
||||
)
|
||||
fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.valueOf(405))
|
||||
}
|
||||
|
||||
@ -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 to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): 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") @Valid @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ class MultipartMixedApiController() {
|
||||
value = ["/multipart-mixed"],
|
||||
consumes = ["multipart/form-data"]
|
||||
)
|
||||
fun multipartMixed(@Parameter(description = "", required = true, schema = Schema(allowableValues = ["ALLOWED", "IN_PROGRESS", "REJECTED"])) @RequestParam(value = "status", required = true) status: MultipartMixedStatus ,@Parameter(description = "a file") @Valid @RequestPart("file", required = true) file: org.springframework.web.multipart.MultipartFile,@Parameter(description = "") @RequestPart(value = "marker", required = false) marker: MultipartMixedRequestMarker? ): ResponseEntity<Unit> {
|
||||
fun multipartMixed(@Parameter(description = "", required = true, schema = Schema(allowableValues = ["ALLOWED", "IN_PROGRESS", "REJECTED"])) @Valid @RequestParam(value = "status", required = true) status: MultipartMixedStatus ,@Parameter(description = "a file") @Valid @RequestPart("file", required = true) file: org.springframework.web.multipart.MultipartFile,@Parameter(description = "") @Valid @RequestPart(value = "marker", required = false) marker: MultipartMixedRequestMarker? ): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/{petId}"],
|
||||
consumes = ["application/x-www-form-urlencoded"]
|
||||
)
|
||||
suspend fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
suspend fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.valueOf(405))
|
||||
}
|
||||
|
||||
@ -177,7 +177,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
produces = ["application/json"],
|
||||
consumes = ["multipart/form-data"]
|
||||
)
|
||||
suspend 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.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
suspend fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||
}
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/{petId}"],
|
||||
consumes = ["application/x-www-form-urlencoded"]
|
||||
)
|
||||
suspend fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
suspend fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.valueOf(405))
|
||||
}
|
||||
|
||||
@ -177,7 +177,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
produces = ["application/json"],
|
||||
consumes = ["multipart/form-data"]
|
||||
)
|
||||
suspend 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.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
suspend fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||
}
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ interface PetApi {
|
||||
value = ["/pet/{petId}"],
|
||||
consumes = ["application/x-www-form-urlencoded"]
|
||||
)
|
||||
fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -196,7 +196,7 @@ interface PetApi {
|
||||
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 to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): 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") @Valid @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/{petId}"],
|
||||
consumes = ["application/x-www-form-urlencoded"]
|
||||
)
|
||||
fun updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@ApiParam(value = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
fun updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) name: kotlin.String? ,@ApiParam(value = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.valueOf(405))
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
produces = ["application/json"],
|
||||
consumes = ["multipart/form-data"]
|
||||
)
|
||||
fun uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
fun uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||
}
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/{petId}"],
|
||||
consumes = ["application/x-www-form-urlencoded"]
|
||||
)
|
||||
fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.valueOf(405))
|
||||
}
|
||||
|
||||
@ -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 to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): 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") @Valid @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||
}
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/{petId}"],
|
||||
consumes = ["application/x-www-form-urlencoded"]
|
||||
)
|
||||
fun updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@ApiParam(value = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
fun updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) name: kotlin.String? ,@ApiParam(value = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.valueOf(405))
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
produces = ["application/json"],
|
||||
consumes = ["multipart/form-data"]
|
||||
)
|
||||
fun uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
fun uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||
}
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/{petId}"],
|
||||
consumes = ["application/x-www-form-urlencoded"]
|
||||
)
|
||||
fun updatePetWithForm( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "name", required = false) name: kotlin.String? , @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
fun updatePetWithForm( @PathVariable("petId") petId: kotlin.Long, @Valid @RequestParam(value = "name", required = false) name: kotlin.String? , @Valid @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity<Unit> {
|
||||
return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.valueOf(405))
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
produces = ["application/json"],
|
||||
consumes = ["multipart/form-data"]
|
||||
)
|
||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @Valid @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user