Skip to content

Commit 4e94f20

Browse files
committed
fix kotlin-spring declarative http interface
1 parent b443080 commit 4e94f20

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-declarative-http-interface

modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-declarative-http-interface/apiInterface.mustache

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ package {{package}}
66

77
{{#imports}}import {{import}}
88
{{/imports}}
9+
{{#useRequestMappingOnInterface}}
10+
import {{#apiPackage}}{{.}}.{{/apiPackage}}{{classname}}.Companion.BASE_PATH
11+
{{/useRequestMappingOnInterface}}
912

1013
{{#swagger2AnnotationLibrary}}
1114
import io.swagger.v3.oas.annotations.*
@@ -48,7 +51,7 @@ import kotlin.collections.List
4851
import kotlin.collections.Map
4952

5053
{{#useRequestMappingOnInterface}}
51-
@HttpExchange("\${api.base-path:{{contextPath}}}")
54+
@HttpExchange(BASE_PATH)
5255
{{/useRequestMappingOnInterface}}
5356
{{#useBeanValidation}}
5457
@Validated
@@ -74,9 +77,7 @@ interface {{classname}} {
7477
{{/operation}}
7578
companion object {
7679
//for your own safety never directly reuse these path definitions in tests
77-
{{#useRequestMappingOnInterface}}
7880
const val BASE_PATH: String = "{{=<% %>=}}<%contextPath%><%={{ }}=%>"
79-
{{/useRequestMappingOnInterface}}
8081
{{#operation}}
8182
const val PATH_{{#lambda.uppercase}}{{#lambda.snakecase}}{{{operationId}}}{{/lambda.snakecase}}{{/lambda.uppercase}}: String = "{{{path}}}"
8283
{{/operation}}

0 commit comments

Comments
 (0)