Skip to content

Commit 0f695d5

Browse files
committed
fix template to avoid unnecessary empty line
1 parent 54160a8 commit 0f695d5

4 files changed

Lines changed: 5 additions & 25 deletions

File tree

modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ import kotlin.collections.Map
6565
class {{classname}}Controller({{#serviceInterface}}@Autowired(required = true) val service: {{classname}}Service{{/serviceInterface}}) {
6666
{{#operation}}
6767

68-
{{^useResponseEntity}}
69-
@ResponseStatus({{#springHttpStatus}}{{#responses.0}}{{{code}}}{{/responses.0}}{{/springHttpStatus}})
70-
{{/useResponseEntity}}
71-
{{#swagger2AnnotationLibrary}}
72-
@Operation(
68+
{{^useResponseEntity}}
69+
@ResponseStatus({{#springHttpStatus}}{{#responses.0}}{{{code}}}{{/responses.0}}{{/springHttpStatus}}){{!
70+
}}{{/useResponseEntity}}{{!
71+
}}{{#swagger2AnnotationLibrary}}{{!
72+
}} @Operation(
7373
summary = "{{{summary}}}",
7474
operationId = "{{{operationId}}}",
7575
description = """{{{unescapedNotes}}}""",

samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/api/PetApiController.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import kotlin.collections.Map
2929
class PetApiController(@Autowired(required = true) val service: PetApiService) {
3030

3131
@ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED)
32-
3332
@RequestMapping(
3433
method = [RequestMethod.POST],
3534
value = ["/pet"],
@@ -40,7 +39,6 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
4039
}
4140

4241
@ResponseStatus(HttpStatus.BAD_REQUEST)
43-
4442
@RequestMapping(
4543
method = [RequestMethod.DELETE],
4644
value = ["/pet/{petId}"]
@@ -50,7 +48,6 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
5048
}
5149

5250
@ResponseStatus(HttpStatus.OK)
53-
5451
@RequestMapping(
5552
method = [RequestMethod.GET],
5653
value = ["/pet/findByStatus"],
@@ -61,7 +58,6 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
6158
}
6259

6360
@ResponseStatus(HttpStatus.OK)
64-
6561
@RequestMapping(
6662
method = [RequestMethod.GET],
6763
value = ["/pet/findByTags"],
@@ -72,7 +68,6 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
7268
}
7369

7470
@ResponseStatus(HttpStatus.OK)
75-
7671
@RequestMapping(
7772
method = [RequestMethod.GET],
7873
value = ["/pet/{petId}"],
@@ -83,7 +78,6 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
8378
}
8479

8580
@ResponseStatus(HttpStatus.BAD_REQUEST)
86-
8781
@RequestMapping(
8882
method = [RequestMethod.PUT],
8983
value = ["/pet"],
@@ -94,7 +88,6 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
9488
}
9589

9690
@ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED)
97-
9891
@RequestMapping(
9992
method = [RequestMethod.POST],
10093
value = ["/pet/{petId}"],
@@ -105,7 +98,6 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
10598
}
10699

107100
@ResponseStatus(HttpStatus.OK)
108-
109101
@RequestMapping(
110102
method = [RequestMethod.POST],
111103
value = ["/pet/{petId}/uploadImage"],

samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/api/StoreApiController.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import kotlin.collections.Map
2828
class StoreApiController(@Autowired(required = true) val service: StoreApiService) {
2929

3030
@ResponseStatus(HttpStatus.BAD_REQUEST)
31-
3231
@RequestMapping(
3332
method = [RequestMethod.DELETE],
3433
value = ["/store/order/{orderId}"]
@@ -38,7 +37,6 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic
3837
}
3938

4039
@ResponseStatus(HttpStatus.OK)
41-
4240
@RequestMapping(
4341
method = [RequestMethod.GET],
4442
value = ["/store/inventory"],
@@ -49,7 +47,6 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic
4947
}
5048

5149
@ResponseStatus(HttpStatus.OK)
52-
5350
@RequestMapping(
5451
method = [RequestMethod.GET],
5552
value = ["/store/order/{orderId}"],
@@ -60,7 +57,6 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic
6057
}
6158

6259
@ResponseStatus(HttpStatus.OK)
63-
6460
@RequestMapping(
6561
method = [RequestMethod.POST],
6662
value = ["/store/order"],

samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/api/UserApiController.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import kotlin.collections.Map
2828
class UserApiController(@Autowired(required = true) val service: UserApiService) {
2929

3030
@ResponseStatus(HttpStatus.OK)
31-
3231
@RequestMapping(
3332
method = [RequestMethod.POST],
3433
value = ["/user"]
@@ -38,7 +37,6 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
3837
}
3938

4039
@ResponseStatus(HttpStatus.OK)
41-
4240
@RequestMapping(
4341
method = [RequestMethod.POST],
4442
value = ["/user/createWithArray"]
@@ -48,7 +46,6 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
4846
}
4947

5048
@ResponseStatus(HttpStatus.OK)
51-
5249
@RequestMapping(
5350
method = [RequestMethod.POST],
5451
value = ["/user/createWithList"]
@@ -58,7 +55,6 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
5855
}
5956

6057
@ResponseStatus(HttpStatus.BAD_REQUEST)
61-
6258
@RequestMapping(
6359
method = [RequestMethod.DELETE],
6460
value = ["/user/{username}"]
@@ -68,7 +64,6 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
6864
}
6965

7066
@ResponseStatus(HttpStatus.OK)
71-
7267
@RequestMapping(
7368
method = [RequestMethod.GET],
7469
value = ["/user/{username}"],
@@ -79,7 +74,6 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
7974
}
8075

8176
@ResponseStatus(HttpStatus.OK)
82-
8377
@RequestMapping(
8478
method = [RequestMethod.GET],
8579
value = ["/user/login"],
@@ -90,7 +84,6 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
9084
}
9185

9286
@ResponseStatus(HttpStatus.OK)
93-
9487
@RequestMapping(
9588
method = [RequestMethod.GET],
9689
value = ["/user/logout"]
@@ -100,7 +93,6 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
10093
}
10194

10295
@ResponseStatus(HttpStatus.BAD_REQUEST)
103-
10496
@RequestMapping(
10597
method = [RequestMethod.PUT],
10698
value = ["/user/{username}"]

0 commit comments

Comments
 (0)