Skip to content

Commit 54160a8

Browse files
committed
fix template to avoid unnecessary empty line
1 parent 3ed53dd commit 54160a8

4 files changed

Lines changed: 5 additions & 25 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ interface {{classname}} {
7676
{{/isDelegate}}
7777
{{#operation}}
7878

79-
{{^useResponseEntity}}
80-
@ResponseStatus({{#springHttpStatus}}{{#responses.0}}{{{code}}}{{/responses.0}}{{/springHttpStatus}})
81-
{{/useResponseEntity}}
82-
{{#swagger2AnnotationLibrary}}
83-
@Operation(
79+
{{^useResponseEntity}}
80+
@ResponseStatus({{#springHttpStatus}}{{#responses.0}}{{{code}}}{{/responses.0}}{{/springHttpStatus}}){{!
81+
}}{{/useResponseEntity}}{{!
82+
}}{{#swagger2AnnotationLibrary}}{{!
83+
}} @Operation(
8484
tags = [{{#tags}}"{{{name}}}",{{/tags}}],
8585
summary = "{{{summary}}}",
8686
operationId = "{{{operationId}}}",

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ interface PetApi {
3535
fun getDelegate(): PetApiDelegate = object: PetApiDelegate {}
3636

3737
@ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED)
38-
3938
@RequestMapping(
4039
method = [RequestMethod.POST],
4140
value = ["/pet"],
@@ -46,7 +45,6 @@ interface PetApi {
4645
}
4746

4847
@ResponseStatus(HttpStatus.BAD_REQUEST)
49-
5048
@RequestMapping(
5149
method = [RequestMethod.DELETE],
5250
value = ["/pet/{petId}"]
@@ -56,7 +54,6 @@ interface PetApi {
5654
}
5755

5856
@ResponseStatus(HttpStatus.OK)
59-
6057
@RequestMapping(
6158
method = [RequestMethod.GET],
6259
value = ["/pet/findByStatus"],
@@ -67,7 +64,6 @@ interface PetApi {
6764
}
6865

6966
@ResponseStatus(HttpStatus.OK)
70-
7167
@RequestMapping(
7268
method = [RequestMethod.GET],
7369
value = ["/pet/findByTags"],
@@ -78,7 +74,6 @@ interface PetApi {
7874
}
7975

8076
@ResponseStatus(HttpStatus.OK)
81-
8277
@RequestMapping(
8378
method = [RequestMethod.GET],
8479
value = ["/pet/{petId}"],
@@ -89,7 +84,6 @@ interface PetApi {
8984
}
9085

9186
@ResponseStatus(HttpStatus.BAD_REQUEST)
92-
9387
@RequestMapping(
9488
method = [RequestMethod.PUT],
9589
value = ["/pet"],
@@ -100,7 +94,6 @@ interface PetApi {
10094
}
10195

10296
@ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED)
103-
10497
@RequestMapping(
10598
method = [RequestMethod.POST],
10699
value = ["/pet/{petId}"],
@@ -111,7 +104,6 @@ interface PetApi {
111104
}
112105

113106
@ResponseStatus(HttpStatus.OK)
114-
115107
@RequestMapping(
116108
method = [RequestMethod.POST],
117109
value = ["/pet/{petId}/uploadImage"],

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ interface StoreApi {
3434
fun getDelegate(): StoreApiDelegate = object: StoreApiDelegate {}
3535

3636
@ResponseStatus(HttpStatus.BAD_REQUEST)
37-
3837
@RequestMapping(
3938
method = [RequestMethod.DELETE],
4039
value = ["/store/order/{orderId}"]
@@ -44,7 +43,6 @@ interface StoreApi {
4443
}
4544

4645
@ResponseStatus(HttpStatus.OK)
47-
4846
@RequestMapping(
4947
method = [RequestMethod.GET],
5048
value = ["/store/inventory"],
@@ -55,7 +53,6 @@ interface StoreApi {
5553
}
5654

5755
@ResponseStatus(HttpStatus.OK)
58-
5956
@RequestMapping(
6057
method = [RequestMethod.GET],
6158
value = ["/store/order/{orderId}"],
@@ -66,7 +63,6 @@ interface StoreApi {
6663
}
6764

6865
@ResponseStatus(HttpStatus.OK)
69-
7066
@RequestMapping(
7167
method = [RequestMethod.POST],
7268
value = ["/store/order"],

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ interface UserApi {
3434
fun getDelegate(): UserApiDelegate = object: UserApiDelegate {}
3535

3636
@ResponseStatus(HttpStatus.OK)
37-
3837
@RequestMapping(
3938
method = [RequestMethod.POST],
4039
value = ["/user"]
@@ -44,7 +43,6 @@ interface UserApi {
4443
}
4544

4645
@ResponseStatus(HttpStatus.OK)
47-
4846
@RequestMapping(
4947
method = [RequestMethod.POST],
5048
value = ["/user/createWithArray"]
@@ -54,7 +52,6 @@ interface UserApi {
5452
}
5553

5654
@ResponseStatus(HttpStatus.OK)
57-
5855
@RequestMapping(
5956
method = [RequestMethod.POST],
6057
value = ["/user/createWithList"]
@@ -64,7 +61,6 @@ interface UserApi {
6461
}
6562

6663
@ResponseStatus(HttpStatus.BAD_REQUEST)
67-
6864
@RequestMapping(
6965
method = [RequestMethod.DELETE],
7066
value = ["/user/{username}"]
@@ -74,7 +70,6 @@ interface UserApi {
7470
}
7571

7672
@ResponseStatus(HttpStatus.OK)
77-
7873
@RequestMapping(
7974
method = [RequestMethod.GET],
8075
value = ["/user/{username}"],
@@ -85,7 +80,6 @@ interface UserApi {
8580
}
8681

8782
@ResponseStatus(HttpStatus.OK)
88-
8983
@RequestMapping(
9084
method = [RequestMethod.GET],
9185
value = ["/user/login"],
@@ -96,7 +90,6 @@ interface UserApi {
9690
}
9791

9892
@ResponseStatus(HttpStatus.OK)
99-
10093
@RequestMapping(
10194
method = [RequestMethod.GET],
10295
value = ["/user/logout"]
@@ -106,7 +99,6 @@ interface UserApi {
10699
}
107100

108101
@ResponseStatus(HttpStatus.BAD_REQUEST)
109-
110102
@RequestMapping(
111103
method = [RequestMethod.PUT],
112104
value = ["/user/{username}"]

0 commit comments

Comments
 (0)