Skip to content

Commit a4e564d

Browse files
committed
Update configs and regenerate samples
1 parent 88286e2 commit a4e564d

16 files changed

Lines changed: 32 additions & 21 deletions

File tree

bin/configs/kotlin-server-jaxrs-spec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ templateDir: modules/openapi-generator/src/main/resources/kotlin-server
66
additionalProperties:
77
useCoroutines: "true"
88
useTags: "true"
9+
implicitHeaders: "true"

bin/configs/kotlin-spring-boot-source-swagger1.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ additionalProperties:
1010
serviceImplementation: "true"
1111
serializableModel: "true"
1212
beanValidations: "true"
13+
implicitHeaders: "true"

bin/configs/kotlin-spring-boot-source-swagger2.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ additionalProperties:
1010
serviceImplementation: "true"
1111
serializableModel: "true"
1212
beanValidations: "true"
13+
implicitHeaders: "true"

samples/server/others/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/apis/DefaultApi.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class DefaultApi {
1515

1616
@GET
1717
@Path("/test/parameters/{path_default}/{path_nullable}")
18-
suspend fun findPetsByStatus(@PathParam("path_default") pathDefault: kotlin.String,@PathParam("path_nullable") pathNullable: kotlin.String,@QueryParam("query_default") @DefaultValue("available") queryDefault: kotlin.String,@QueryParam("query_default_enum") @DefaultValue("B") queryDefaultEnum: kotlin.String,@QueryParam("query_default_int") @DefaultValue("3") queryDefaultInt: java.math.BigDecimal,@HeaderParam("header_default") @DefaultValue("available") headerDefault: kotlin.String,@HeaderParam("header_default_enum") @DefaultValue("B") headerDefaultEnum: kotlin.String,@HeaderParam("header_default_int") @DefaultValue("3") headerDefaultInt: java.math.BigDecimal,@CookieParam("cookie_default") @DefaultValue("available") cookieDefault: kotlin.String,@CookieParam("cookie_default_enum") @DefaultValue("B") cookieDefaultEnum: kotlin.String,@CookieParam("cookie_default_int") @DefaultValue("3") cookieDefaultInt: java.math.BigDecimal,@QueryParam("query_nullable") queryNullable: kotlin.String?,@HeaderParam("header_nullable") headerNullable: kotlin.String?,@CookieParam("cookie_nullable") cookieNullable: kotlin.String?,@QueryParam("\$query-\$dollar-sign") dollarQueryDollarDollarSign: kotlin.String?): Response {
18+
suspend fun findPetsByStatus(@PathParam("path_default") pathDefault: kotlin.String,@PathParam("path_nullable") pathNullable: kotlin.String,@QueryParam("query_default") @DefaultValue("available") queryDefault: kotlin.String,@QueryParam("query_default_enum") @DefaultValue("B") queryDefaultEnum: kotlin.String,@QueryParam("query_default_int") @DefaultValue("3") queryDefaultInt: java.math.BigDecimal,@HeaderParam("header_default") @DefaultValue("available") headerDefault: kotlin.String,@HeaderParam("header_default_enum") @DefaultValue("B") headerDefaultEnum: kotlin.String,@HeaderParam("header_default_int") @DefaultValue("3") headerDefaultInt: java.math.BigDecimal,@CookieParam("cookie_default") @DefaultValue("available") cookieDefault: kotlin.String,@CookieParam("cookie_default_enum") @DefaultValue("B") cookieDefaultEnum: kotlin.String,@CookieParam("cookie_default_int") @DefaultValue("3") cookieDefaultInt: java.math.BigDecimal,@QueryParam("query_nullable") queryNullable: kotlin.String?,@HeaderParam("header_nullable") headerNullable: kotlin.String?,@CookieParam("cookie_nullable") cookieNullable: kotlin.String?,@QueryParam("\$query-\$dollar-sign") dollarQueryDollarDollarSign: kotlin.String?): Response {
1919
return Response.ok().entity("magic!").build();
2020
}
2121
}

samples/server/petstore/kotlin-server/jaxrs-spec-mutiny/src/main/kotlin/org/openapitools/server/apis/PetApi.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ interface PetApi {
2222

2323
@DELETE
2424
@Path("/pet/{petId}")
25-
fun deletePet(@PathParam("petId") petId: kotlin.Long,@HeaderParam("api_key") apiKey: kotlin.String?): io.smallrye.mutiny.Uni<Response>
25+
fun deletePet(@PathParam("petId") petId: kotlin.Long,@HeaderParam("api_key") apiKey: kotlin.String?): io.smallrye.mutiny.Uni<Response>
2626

2727
@GET
2828
@Path("/pet/findByStatus")
2929
@Produces("application/xml", "application/json")
30-
fun findPetsByStatus(@QueryParam("status") status: kotlin.collections.List<kotlin.String>): io.smallrye.mutiny.Uni<Response>
30+
fun findPetsByStatus(@QueryParam("status") status: kotlin.collections.List<kotlin.String>): io.smallrye.mutiny.Uni<Response>
3131

3232
@GET
3333
@Path("/pet/findByTags")
3434
@Produces("application/xml", "application/json")
35-
fun findPetsByTags(@QueryParam("tags") tags: kotlin.collections.List<kotlin.String>): io.smallrye.mutiny.Uni<Response>
35+
fun findPetsByTags(@QueryParam("tags") tags: kotlin.collections.List<kotlin.String>): io.smallrye.mutiny.Uni<Response>
3636

3737
@GET
3838
@Path("/pet/{petId}")

samples/server/petstore/kotlin-server/jaxrs-spec-mutiny/src/main/kotlin/org/openapitools/server/apis/UserApi.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ interface UserApi {
3838
@GET
3939
@Path("/user/login")
4040
@Produces("application/xml", "application/json")
41-
fun loginUser(@QueryParam("username") username: kotlin.String,@QueryParam("password") password: kotlin.String): io.smallrye.mutiny.Uni<Response>
41+
fun loginUser(@QueryParam("username") username: kotlin.String,@QueryParam("password") password: kotlin.String): io.smallrye.mutiny.Uni<Response>
4242

4343
@GET
4444
@Path("/user/logout")

samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/apis/PetApi.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ class PetApi {
2323

2424
@DELETE
2525
@Path("/{petId}")
26-
suspend fun deletePet(@PathParam("petId") petId: kotlin.Long,@HeaderParam("api_key") apiKey: kotlin.String?): Response {
26+
suspend fun deletePet(@PathParam("petId") petId: kotlin.Long): Response {
2727
return Response.ok().entity("magic!").build();
2828
}
2929

3030
@GET
3131
@Path("/findByStatus")
3232
@Produces("application/xml", "application/json")
33-
suspend fun findPetsByStatus(@QueryParam("status") status: kotlin.collections.List<kotlin.String>): Response {
33+
suspend fun findPetsByStatus(@QueryParam("status") status: kotlin.collections.List<kotlin.String>): Response {
3434
return Response.ok().entity("magic!").build();
3535
}
3636

3737
@GET
3838
@Path("/findByTags")
3939
@Produces("application/xml", "application/json")
40-
suspend fun findPetsByTags(@QueryParam("tags") tags: kotlin.collections.List<kotlin.String>): Response {
40+
suspend fun findPetsByTags(@QueryParam("tags") tags: kotlin.collections.List<kotlin.String>): Response {
4141
return Response.ok().entity("magic!").build();
4242
}
4343

samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/apis/UserApi.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class UserApi {
4747
@GET
4848
@Path("/login")
4949
@Produces("application/xml", "application/json")
50-
suspend fun loginUser(@QueryParam("username") username: kotlin.String,@QueryParam("password") password: kotlin.String): Response {
50+
suspend fun loginUser(@QueryParam("username") username: kotlin.String,@QueryParam("password") password: kotlin.String): Response {
5151
return Response.ok().entity("magic!").build();
5252
}
5353

samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiController.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package org.openapitools.api
33
import org.openapitools.model.ModelApiResponse
44
import org.openapitools.model.Pet
55
import io.swagger.annotations.Api
6+
import io.swagger.annotations.ApiImplicitParam
7+
import io.swagger.annotations.ApiImplicitParams
68
import io.swagger.annotations.ApiOperation
79
import io.swagger.annotations.ApiParam
810
import io.swagger.annotations.ApiResponse
@@ -65,16 +67,18 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
6567
authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])])
6668
@ApiResponses(
6769
value = [ApiResponse(code = 400, message = "Invalid pet value")])
70+
@ApiImplicitParams(value = [
71+
ApiImplicitParam(name = "api_key", value = "", dataType = "kotlin.String", paramType = "header")
72+
])
6873
@RequestMapping(
6974
method = [RequestMethod.DELETE],
7075
// "/pet/{petId}"
7176
value = [PATH_DELETE_PET]
7277
)
7378
fun deletePet(
74-
@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long,
75-
@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) apiKey: kotlin.String?
79+
@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long
7680
): ResponseEntity<Unit> {
77-
return ResponseEntity(service.deletePet(petId, apiKey), HttpStatus.valueOf(400))
81+
return ResponseEntity(service.deletePet(petId), HttpStatus.valueOf(400))
7882
}
7983

8084

samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiService.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ interface PetApiService {
1818
* DELETE /pet/{petId} : Deletes a pet
1919
*
2020
* @param petId Pet id to delete (required)
21-
* @param apiKey (optional)
2221
* @return Invalid pet value (status code 400)
2322
* @see PetApi#deletePet
2423
*/
25-
fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit
24+
fun deletePet(petId: kotlin.Long): Unit
2625

2726
/**
2827
* GET /pet/findByStatus : Finds Pets by status

0 commit comments

Comments
 (0)