mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
Merge b4d799f010a402047356f077575ddfaa018566e2 into 2fb26c362ea6557c90353606ccdc3c446d6a8f35
This commit is contained in:
commit
c630e13eac
@ -1 +1 @@
|
||||
{{#isQueryParam}}{{^isModel}} @RequestParam(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}){{/isModel}}{{#isDate}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE){{/isDate}}{{#isDateTime}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME){{/isDateTime}} {{{paramName}}}: {{>optionalDataType}}{{/isQueryParam}}
|
||||
{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{#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}}{{^isContainer}}{{#defaultValue}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}){{/swagger1AnnotationLibrary}}{{#useBeanValidation}} @Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}){{/isModel}}{{#isDate}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE){{/isDate}}{{#isDateTime}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME){{/isDateTime}} {{{paramName}}}: {{>optionalDataType}}{{/isQueryParam}}
|
@ -1137,4 +1137,59 @@ public class KotlinSpringServerCodegenTest {
|
||||
assertFileNotContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV1ApiService.kt"),
|
||||
"Flow<kotlin.String>");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidationsInQueryParams_issue21238_Controller() throws IOException {
|
||||
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
|
||||
KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
|
||||
codegen.setOutputDir(output.getAbsolutePath());
|
||||
|
||||
List<File> files = new DefaultGenerator()
|
||||
.opts(
|
||||
new ClientOptInput()
|
||||
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue21238_queryParam_validation.yaml"))
|
||||
.config(codegen)
|
||||
)
|
||||
.generate();
|
||||
|
||||
Assertions.assertThat(files).contains(
|
||||
new File(output, "src/main/kotlin/org/openapitools/api/PetApiController.kt"),
|
||||
new File(output, "src/main/kotlin/org/openapitools/api/UserApiController.kt")
|
||||
);
|
||||
|
||||
assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/PetApiController.kt"),
|
||||
"@NotNull", "@Valid");
|
||||
assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/UserApiController.kt"),
|
||||
"@NotNull", "@Valid",
|
||||
"@Pattern(regexp=\"^[a-zA-Z0-9]+[a-zA-Z0-9\\\\.\\\\-_]*[a-zA-Z0-9]+$\")",
|
||||
"@Parameter(description = \"The user name for login\", required = true)",
|
||||
"@Parameter(description = \"The password for login in clear text\", required = true)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidationsInQueryParams_issue21238_Api_Delegate() throws IOException {
|
||||
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
|
||||
KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
|
||||
codegen.setOutputDir(output.getAbsolutePath());
|
||||
codegen.additionalProperties().put(KotlinSpringServerCodegen.DELEGATE_PATTERN, true);
|
||||
|
||||
List<File> files = new DefaultGenerator()
|
||||
.opts(
|
||||
new ClientOptInput()
|
||||
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue21238_queryParam_validation.yaml"))
|
||||
.config(codegen)
|
||||
)
|
||||
.generate();
|
||||
|
||||
Assertions.assertThat(files).contains(
|
||||
new File(output, "src/main/kotlin/org/openapitools/api/PetApi.kt"),
|
||||
new File(output, "src/main/kotlin/org/openapitools/api/UserApi.kt")
|
||||
);
|
||||
|
||||
assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/PetApi.kt"),
|
||||
"@NotNull", "@Valid");
|
||||
assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/UserApi.kt"),
|
||||
"@NotNull", "@Valid", "@Pattern(regexp=\"^[a-zA-Z0-9]+[a-zA-Z0-9\\\\.\\\\-_]*[a-zA-Z0-9]+$\")");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,61 @@
|
||||
openapi: 3.0.0
|
||||
info:
|
||||
description: "Example to test fix for issue 21238, queryParam validation"
|
||||
license:
|
||||
name: Apache-2.0
|
||||
url: https://www.apache.org/licenses/LICENSE-2.0.html
|
||||
title: OpenAPI Query Param VAlidation
|
||||
version: 1.0.0
|
||||
paths:
|
||||
/pet/findByStatus:
|
||||
get:
|
||||
description: Multiple status values can be provided with comma separated strings
|
||||
operationId: findPetsByStatus
|
||||
parameters:
|
||||
- deprecated: true
|
||||
description: Status values that need to be considered for filter
|
||||
explode: false
|
||||
in: query
|
||||
name: status
|
||||
required: true
|
||||
schema:
|
||||
items:
|
||||
default: available
|
||||
enum:
|
||||
- available
|
||||
- pending
|
||||
- sold
|
||||
type: string
|
||||
type: array
|
||||
style: form
|
||||
responses:
|
||||
"200":
|
||||
summary: Finds Pets by status
|
||||
tags:
|
||||
- pet
|
||||
/user/login:
|
||||
get:
|
||||
operationId: loginUser
|
||||
parameters:
|
||||
- description: The user name for login
|
||||
explode: true
|
||||
in: query
|
||||
name: username
|
||||
required: true
|
||||
schema:
|
||||
pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$"
|
||||
type: string
|
||||
style: form
|
||||
- description: The password for login in clear text
|
||||
explode: true
|
||||
in: query
|
||||
name: password
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
style: form
|
||||
responses:
|
||||
"200":
|
||||
summary: Logs user into the system
|
||||
tags:
|
||||
- user
|
@ -58,7 +58,7 @@ interface PetApi {
|
||||
value = ["/pet/findByStatus"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByStatus( @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByStatus(@NotNull @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ interface PetApi {
|
||||
value = ["/pet/findByTags"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByTags( @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByTags(@NotNull @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ interface UserApi {
|
||||
value = ["/user/login"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun loginUser( @RequestParam(value = "username", required = true) username: kotlin.String, @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ class PetApiController() {
|
||||
value = ["/pet/findByStatus"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByStatus( @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ class PetApiController() {
|
||||
value = ["/pet/findByTags"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByTags( @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ class UserApiController() {
|
||||
value = ["/user/login"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun loginUser( @RequestParam(value = "username", required = true) username: kotlin.String, @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/findByStatus"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByStatus( @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByStatus(@NotNull @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/findByTags"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByTags( @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByTags(@NotNull @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(service.findPetsByTags(tags), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
|
||||
value = ["/user/login"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun loginUser( @RequestParam(value = "username", required = true) username: kotlin.String, @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
return ResponseEntity(service.loginUser(username, password), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ interface PetApi {
|
||||
value = ["/pet/findByStatus"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByStatus( @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return getDelegate().findPetsByStatus(status)
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ interface PetApi {
|
||||
value = ["/pet/findByTags"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByTags( @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return getDelegate().findPetsByTags(tags)
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ interface UserApi {
|
||||
value = ["/user/login"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun loginUser( @RequestParam(value = "username", required = true) username: kotlin.String, @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
return getDelegate().loginUser(username, password)
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ interface PetApi {
|
||||
value = ["/pet/findByStatus"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByStatus( @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return getDelegate().findPetsByStatus(status)
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ interface PetApi {
|
||||
value = ["/pet/findByTags"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByTags( @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return getDelegate().findPetsByTags(tags)
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,7 @@ interface UserApi {
|
||||
value = ["/user/login"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun loginUser( @RequestParam(value = "username", required = true) username: kotlin.String, @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
return getDelegate().loginUser(username, password)
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/findByStatus"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByStatus( @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/findByTags"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByTags( @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(service.findPetsByTags(tags), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
|
||||
value = ["/user/login"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun loginUser( @RequestParam(value = "username", required = true) username: kotlin.String, @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
fun loginUser(@NotNull @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
return ResponseEntity(service.loginUser(username, password), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/findByStatus"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
suspend fun findPetsByStatus( @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
suspend fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/findByTags"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
suspend fun findPetsByTags( @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
suspend fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(service.findPetsByTags(tags), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
|
||||
value = ["/user/login"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
suspend fun loginUser( @RequestParam(value = "username", required = true) username: kotlin.String, @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
suspend fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
return ResponseEntity(service.loginUser(username, password), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/findByStatus"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByStatus( @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<Flow<Pet>> {
|
||||
fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<Flow<Pet>> {
|
||||
return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/findByTags"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByTags( @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<Flow<Pet>> {
|
||||
fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<Flow<Pet>> {
|
||||
return ResponseEntity(service.findPetsByTags(tags), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
|
||||
value = ["/user/login"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
suspend fun loginUser( @RequestParam(value = "username", required = true) username: kotlin.String, @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
suspend fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
return ResponseEntity(service.loginUser(username, password), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ interface PetApi {
|
||||
value = ["/pet/findByStatus"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByStatus( @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ interface PetApi {
|
||||
value = ["/pet/findByTags"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByTags( @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ interface UserApi {
|
||||
value = ["/user/login"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun loginUser( @RequestParam(value = "username", required = true) username: kotlin.String, @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
fun loginUser(@NotNull @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/findByStatus"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByStatus( @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/findByTags"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByTags( @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(service.findPetsByTags(tags), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
|
||||
value = ["/user/login"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun loginUser( @RequestParam(value = "username", required = true) username: kotlin.String, @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
fun loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
return ResponseEntity(service.loginUser(username, password), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/findByStatus"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByStatus( @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/findByTags"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByTags( @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(service.findPetsByTags(tags), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
|
||||
value = ["/user/login"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun loginUser( @RequestParam(value = "username", required = true) username: kotlin.String, @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
fun loginUser(@NotNull @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
return ResponseEntity(service.loginUser(username, password), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/findByStatus"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByStatus( @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/findByTags"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByTags( @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(service.findPetsByTags(tags), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
|
||||
value = ["/user/login"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun loginUser( @RequestParam(value = "username", required = true) username: kotlin.String, @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
fun loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
return ResponseEntity(service.loginUser(username, password), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/findByStatus"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByStatus( @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByStatus(@NotNull @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
value = ["/pet/findByTags"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun findPetsByTags( @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
fun findPetsByTags(@NotNull @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
|
||||
return ResponseEntity(service.findPetsByTags(tags), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
|
||||
value = ["/user/login"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
fun loginUser( @RequestParam(value = "username", required = true) username: kotlin.String, @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
fun loginUser(@NotNull @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
return ResponseEntity(service.loginUser(username, password), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user