Skip to content

Commit 59e712c

Browse files
author
andrewwilsonnew
committed
cleanup
1 parent 5523cc0 commit 59e712c

4 files changed

Lines changed: 23 additions & 23 deletions

File tree

modules/openapi-generator/src/main/resources/kotlin-misk/apiAction.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import misk.web.RequestContentType
2727
import misk.web.RequestHeader
2828
import misk.web.ResponseContentType
2929
import misk.web.mediatype.MediaTypes{{#actionImports}}
30-
{{.}}{{/actionImports}}
30+
{{{.}}}{{/actionImports}}
3131
{{#imports}}import {{import}}
3232
{{/imports}}
3333

@@ -40,11 +40,11 @@ class {{classname}}Action @Inject constructor(
4040
) : {{actionParentClass}} {
4141
{{#operation}}
4242

43-
@{{httpMethod}}("{{actionPathPrefix}}{{path}}")
43+
@{{httpMethod}}("{{{actionPathPrefix}}}{{path}}")
4444
@Description("{{{summary}}}"){{#hasConsumes}}
4545
@RequestContentType({{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}){{/hasConsumes}}{{#hasProduces}}
4646
@ResponseContentType({{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}){{/hasProduces}}{{#actionAnnotations}}
47-
{{.}}{{/actionAnnotations}}
47+
{{{.}}}{{/actionAnnotations}}
4848
fun {{operationId}}({{#allParams}}
4949
{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>cookieParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}: {{{returnType}}}{{/returnType}} {
5050
TODO()

samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/api/PetApiAction.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ class PetApiAction @Inject constructor(
4040
@Description("Add a new pet to the store")
4141
@RequestContentType(MediaTypes.APPLICATION_JSON, MediaTypes.APPLICATION_XML)
4242
@ResponseContentType(MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON)
43-
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
43+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
4444
fun addPet(
4545
@Valid @RequestBody pet: Pet): Pet {
4646
TODO()
4747
}
4848

4949
@Delete("samplePrefix/pet/{petId}")
5050
@Description("Deletes a pet")
51-
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
51+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
5252
fun deletePet(
5353
@PathParam("petId") petId: kotlin.Long,
5454
@RequestHeader(value = "api_key") apiKey: kotlin.String?) {
@@ -58,7 +58,7 @@ class PetApiAction @Inject constructor(
5858
@Get("samplePrefix/pet/findByStatus")
5959
@Description("Finds Pets by status")
6060
@ResponseContentType(MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON)
61-
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
61+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
6262
fun findPetsByStatus(
6363
@QueryParam(value = "status") status: kotlin.Array<kotlin.String>): kotlin.Array<Pet> {
6464
TODO()
@@ -67,7 +67,7 @@ class PetApiAction @Inject constructor(
6767
@Get("samplePrefix/pet/findByTags")
6868
@Description("Finds Pets by tags")
6969
@ResponseContentType(MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON)
70-
@LogRequestResponse(bodySampling &#x3D; 1.0, errorBodySampling &#x3D; 1.0)
70+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
7171
fun findPetsByTags(
7272
@QueryParam(value = "tags") tags: kotlin.Array<kotlin.String>): kotlin.Array<Pet> {
7373
TODO()
@@ -76,7 +76,7 @@ class PetApiAction @Inject constructor(
7676
@Get("samplePrefix/pet/{petId}")
7777
@Description("Find pet by ID")
7878
@ResponseContentType(MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON)
79-
@LogRequestResponse(bodySampling &#x3D; 1.0, errorBodySampling &#x3D; 1.0)
79+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
8080
fun getPetById(
8181
@PathParam("petId") petId: kotlin.Long): Pet {
8282
TODO()
@@ -86,7 +86,7 @@ class PetApiAction @Inject constructor(
8686
@Description("Update an existing pet")
8787
@RequestContentType(MediaTypes.APPLICATION_JSON, MediaTypes.APPLICATION_XML)
8888
@ResponseContentType(MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON)
89-
@LogRequestResponse(bodySampling &#x3D; 1.0, errorBodySampling &#x3D; 1.0)
89+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
9090
fun updatePet(
9191
@Valid @RequestBody pet: Pet): Pet {
9292
TODO()
@@ -95,7 +95,7 @@ class PetApiAction @Inject constructor(
9595
@Post("samplePrefix/pet/{petId}")
9696
@Description("Updates a pet in the store with form data")
9797
@RequestContentType(MediaTypes.APPLICATION_FORM_URLENCODED)
98-
@LogRequestResponse(bodySampling &#x3D; 1.0, errorBodySampling &#x3D; 1.0)
98+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
9999
fun updatePetWithForm(
100100
@PathParam("petId") petId: kotlin.Long,
101101
@QueryParam(value = "name") name: kotlin.String? ,
@@ -107,7 +107,7 @@ class PetApiAction @Inject constructor(
107107
@Description("uploads an image")
108108
@RequestContentType(MediaTypes.FORM_DATA)
109109
@ResponseContentType(MediaTypes.APPLICATION_JSON)
110-
@LogRequestResponse(bodySampling &#x3D; 1.0, errorBodySampling &#x3D; 1.0)
110+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
111111
fun uploadFile(
112112
@PathParam("petId") petId: kotlin.Long,
113113
@QueryParam(value = "additionalMetadata") additionalMetadata: kotlin.String? ,

samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/api/StoreApiAction.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class StoreApiAction @Inject constructor(
3737

3838
@Delete("samplePrefix/store/order/{orderId}")
3939
@Description("Delete purchase order by ID")
40-
@LogRequestResponse(bodySampling &#x3D; 1.0, errorBodySampling &#x3D; 1.0)
40+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
4141
fun deleteOrder(
4242
@PathParam("orderId") orderId: kotlin.String) {
4343
TODO()
@@ -46,15 +46,15 @@ class StoreApiAction @Inject constructor(
4646
@Get("samplePrefix/store/inventory")
4747
@Description("Returns pet inventories by status")
4848
@ResponseContentType(MediaTypes.APPLICATION_JSON)
49-
@LogRequestResponse(bodySampling &#x3D; 1.0, errorBodySampling &#x3D; 1.0)
49+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
5050
fun getInventory(): kotlin.collections.Map<kotlin.String, kotlin.Int> {
5151
TODO()
5252
}
5353

5454
@Get("samplePrefix/store/order/{orderId}")
5555
@Description("Find purchase order by ID")
5656
@ResponseContentType(MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON)
57-
@LogRequestResponse(bodySampling &#x3D; 1.0, errorBodySampling &#x3D; 1.0)
57+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
5858
fun getOrderById(
5959
@Min(1L) @Max(5L) @PathParam("orderId") orderId: kotlin.Long): Order {
6060
TODO()
@@ -64,7 +64,7 @@ class StoreApiAction @Inject constructor(
6464
@Description("Place an order for a pet")
6565
@RequestContentType(MediaTypes.APPLICATION_JSON)
6666
@ResponseContentType(MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON)
67-
@LogRequestResponse(bodySampling &#x3D; 1.0, errorBodySampling &#x3D; 1.0)
67+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
6868
fun placeOrder(
6969
@Valid @RequestBody order: Order): Order {
7070
TODO()

samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/api/UserApiAction.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class UserApiAction @Inject constructor(
3838
@Post("samplePrefix/user")
3939
@Description("Create user")
4040
@RequestContentType(MediaTypes.APPLICATION_JSON)
41-
@LogRequestResponse(bodySampling &#x3D; 1.0, errorBodySampling &#x3D; 1.0)
41+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
4242
fun createUser(
4343
@Valid @RequestBody user: User) {
4444
TODO()
@@ -47,7 +47,7 @@ class UserApiAction @Inject constructor(
4747
@Post("samplePrefix/user/createWithArray")
4848
@Description("Creates list of users with given input array")
4949
@RequestContentType(MediaTypes.APPLICATION_JSON)
50-
@LogRequestResponse(bodySampling &#x3D; 1.0, errorBodySampling &#x3D; 1.0)
50+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
5151
fun createUsersWithArrayInput(
5252
@Valid @RequestBody user: kotlin.Array<User>) {
5353
TODO()
@@ -56,15 +56,15 @@ class UserApiAction @Inject constructor(
5656
@Post("samplePrefix/user/createWithList")
5757
@Description("Creates list of users with given input array")
5858
@RequestContentType(MediaTypes.APPLICATION_JSON)
59-
@LogRequestResponse(bodySampling &#x3D; 1.0, errorBodySampling &#x3D; 1.0)
59+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
6060
fun createUsersWithListInput(
6161
@Valid @RequestBody user: kotlin.Array<User>) {
6262
TODO()
6363
}
6464

6565
@Delete("samplePrefix/user/{username}")
6666
@Description("Delete user")
67-
@LogRequestResponse(bodySampling &#x3D; 1.0, errorBodySampling &#x3D; 1.0)
67+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
6868
fun deleteUser(
6969
@PathParam("username") username: kotlin.String) {
7070
TODO()
@@ -73,7 +73,7 @@ class UserApiAction @Inject constructor(
7373
@Get("samplePrefix/user/{username}")
7474
@Description("Get user by user name")
7575
@ResponseContentType(MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON)
76-
@LogRequestResponse(bodySampling &#x3D; 1.0, errorBodySampling &#x3D; 1.0)
76+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
7777
fun getUserByName(
7878
@PathParam("username") username: kotlin.String): User {
7979
TODO()
@@ -82,7 +82,7 @@ class UserApiAction @Inject constructor(
8282
@Get("samplePrefix/user/login")
8383
@Description("Logs user into the system")
8484
@ResponseContentType(MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON)
85-
@LogRequestResponse(bodySampling &#x3D; 1.0, errorBodySampling &#x3D; 1.0)
85+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
8686
fun loginUser(
8787
@QueryParam(value = "username") username: kotlin.String,
8888
@QueryParam(value = "password") password: kotlin.String): kotlin.String {
@@ -91,15 +91,15 @@ class UserApiAction @Inject constructor(
9191

9292
@Get("samplePrefix/user/logout")
9393
@Description("Logs out current logged in user session")
94-
@LogRequestResponse(bodySampling &#x3D; 1.0, errorBodySampling &#x3D; 1.0)
94+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
9595
fun logoutUser() {
9696
TODO()
9797
}
9898

9999
@Put("samplePrefix/user/{username}")
100100
@Description("Updated user")
101101
@RequestContentType(MediaTypes.APPLICATION_JSON)
102-
@LogRequestResponse(bodySampling &#x3D; 1.0, errorBodySampling &#x3D; 1.0)
102+
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0)
103103
fun updateUser(
104104
@PathParam("username") username: kotlin.String,
105105
@Valid @RequestBody user: User) {

0 commit comments

Comments
 (0)