From 2da7a95a1155122fea2292c96905894fe1f35bf9 Mon Sep 17 00:00:00 2001 From: Raphael Ouazana Date: Fri, 22 Dec 2023 17:59:25 +0100 Subject: [PATCH] [#17465] Fix Kotlin templates to be compatible with Kotlin K2 compiler --- .../src/main/resources/kotlin-spring/apiController.mustache | 2 +- .../src/main/resources/kotlin-vertx-server/apiProxy.mustache | 2 +- .../src/main/kotlin/org/openapitools/api/PetApiController.kt | 2 +- .../src/main/kotlin/org/openapitools/api/StoreApiController.kt | 2 +- .../src/main/kotlin/org/openapitools/api/UserApiController.kt | 2 +- .../openapitools/server/api/verticle/PetApiVertxProxyHandler.kt | 2 +- .../server/api/verticle/StoreApiVertxProxyHandler.kt | 2 +- .../server/api/verticle/UserApiVertxProxyHandler.kt | 2 +- .../openapitools/server/api/verticle/PetApiVertxProxyHandler.kt | 2 +- .../server/api/verticle/StoreApiVertxProxyHandler.kt | 2 +- .../server/api/verticle/UserApiVertxProxyHandler.kt | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/apiController.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/apiController.mustache index 037b9d93d733..fcbc8cc37bca 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/apiController.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/apiController.mustache @@ -13,7 +13,7 @@ import java.util.Optional class {{classname}}Controller( @org.springframework.beans.factory.annotation.Autowired(required = false) delegate: {{classname}}Delegate? ) : {{classname}} { - private val delegate: {{classname}}Delegate + private lateinit var delegate: {{classname}}Delegate init { this.delegate = Optional.ofNullable(delegate).orElse(object : {{classname}}Delegate {}) diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/apiProxy.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/apiProxy.mustache index e689c36f3fd8..31d71455db92 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/apiProxy.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/apiProxy.mustache @@ -20,7 +20,7 @@ import com.google.gson.Gson {{/imports}} class {{classname}}VertxProxyHandler(private val vertx: Vertx, private val service: {{classname}}, topLevel: Boolean, private val timeoutSeconds: Long) : ProxyHandler() { - private val timerID: Long + private lateinit var timerID: Long private var lastAccessed: Long = 0 init { try { diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiController.kt index ac2e8fb60763..931361743fd4 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -10,7 +10,7 @@ import java.util.Optional class PetApiController( @org.springframework.beans.factory.annotation.Autowired(required = false) delegate: PetApiDelegate? ) : PetApi { - private val delegate: PetApiDelegate + private lateinit var delegate: PetApiDelegate init { this.delegate = Optional.ofNullable(delegate).orElse(object : PetApiDelegate {}) diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiController.kt index 3f52082c4c0e..555c2f196fc7 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -10,7 +10,7 @@ import java.util.Optional class StoreApiController( @org.springframework.beans.factory.annotation.Autowired(required = false) delegate: StoreApiDelegate? ) : StoreApi { - private val delegate: StoreApiDelegate + private lateinit var delegate: StoreApiDelegate init { this.delegate = Optional.ofNullable(delegate).orElse(object : StoreApiDelegate {}) diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiController.kt index a9b1b3300c02..5c8903538c5c 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -10,7 +10,7 @@ import java.util.Optional class UserApiController( @org.springframework.beans.factory.annotation.Autowired(required = false) delegate: UserApiDelegate? ) : UserApi { - private val delegate: UserApiDelegate + private lateinit var delegate: UserApiDelegate init { this.delegate = Optional.ofNullable(delegate).orElse(object : UserApiDelegate {}) diff --git a/samples/server/petstore/kotlin-vertx-modelMutable/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt b/samples/server/petstore/kotlin-vertx-modelMutable/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt index 644fc1cee83a..05ca5658f485 100644 --- a/samples/server/petstore/kotlin-vertx-modelMutable/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt +++ b/samples/server/petstore/kotlin-vertx-modelMutable/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt @@ -20,7 +20,7 @@ import org.openapitools.server.api.model.ModelApiResponse import org.openapitools.server.api.model.Pet class PetApiVertxProxyHandler(private val vertx: Vertx, private val service: PetApi, topLevel: Boolean, private val timeoutSeconds: Long) : ProxyHandler() { - private val timerID: Long + private lateinit var timerID: Long private var lastAccessed: Long = 0 init { try { diff --git a/samples/server/petstore/kotlin-vertx-modelMutable/src/main/kotlin/org/openapitools/server/api/verticle/StoreApiVertxProxyHandler.kt b/samples/server/petstore/kotlin-vertx-modelMutable/src/main/kotlin/org/openapitools/server/api/verticle/StoreApiVertxProxyHandler.kt index 985b9249f56d..a43d60b0619e 100644 --- a/samples/server/petstore/kotlin-vertx-modelMutable/src/main/kotlin/org/openapitools/server/api/verticle/StoreApiVertxProxyHandler.kt +++ b/samples/server/petstore/kotlin-vertx-modelMutable/src/main/kotlin/org/openapitools/server/api/verticle/StoreApiVertxProxyHandler.kt @@ -19,7 +19,7 @@ import com.google.gson.Gson import org.openapitools.server.api.model.Order class StoreApiVertxProxyHandler(private val vertx: Vertx, private val service: StoreApi, topLevel: Boolean, private val timeoutSeconds: Long) : ProxyHandler() { - private val timerID: Long + private lateinit var timerID: Long private var lastAccessed: Long = 0 init { try { diff --git a/samples/server/petstore/kotlin-vertx-modelMutable/src/main/kotlin/org/openapitools/server/api/verticle/UserApiVertxProxyHandler.kt b/samples/server/petstore/kotlin-vertx-modelMutable/src/main/kotlin/org/openapitools/server/api/verticle/UserApiVertxProxyHandler.kt index beee4405bee1..4ed3ed309b5c 100644 --- a/samples/server/petstore/kotlin-vertx-modelMutable/src/main/kotlin/org/openapitools/server/api/verticle/UserApiVertxProxyHandler.kt +++ b/samples/server/petstore/kotlin-vertx-modelMutable/src/main/kotlin/org/openapitools/server/api/verticle/UserApiVertxProxyHandler.kt @@ -19,7 +19,7 @@ import com.google.gson.Gson import org.openapitools.server.api.model.User class UserApiVertxProxyHandler(private val vertx: Vertx, private val service: UserApi, topLevel: Boolean, private val timeoutSeconds: Long) : ProxyHandler() { - private val timerID: Long + private lateinit var timerID: Long private var lastAccessed: Long = 0 init { try { diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt index 644fc1cee83a..05ca5658f485 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt @@ -20,7 +20,7 @@ import org.openapitools.server.api.model.ModelApiResponse import org.openapitools.server.api.model.Pet class PetApiVertxProxyHandler(private val vertx: Vertx, private val service: PetApi, topLevel: Boolean, private val timeoutSeconds: Long) : ProxyHandler() { - private val timerID: Long + private lateinit var timerID: Long private var lastAccessed: Long = 0 init { try { diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/StoreApiVertxProxyHandler.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/StoreApiVertxProxyHandler.kt index 985b9249f56d..a43d60b0619e 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/StoreApiVertxProxyHandler.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/StoreApiVertxProxyHandler.kt @@ -19,7 +19,7 @@ import com.google.gson.Gson import org.openapitools.server.api.model.Order class StoreApiVertxProxyHandler(private val vertx: Vertx, private val service: StoreApi, topLevel: Boolean, private val timeoutSeconds: Long) : ProxyHandler() { - private val timerID: Long + private lateinit var timerID: Long private var lastAccessed: Long = 0 init { try { diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApiVertxProxyHandler.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApiVertxProxyHandler.kt index beee4405bee1..4ed3ed309b5c 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApiVertxProxyHandler.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApiVertxProxyHandler.kt @@ -19,7 +19,7 @@ import com.google.gson.Gson import org.openapitools.server.api.model.User class UserApiVertxProxyHandler(private val vertx: Vertx, private val service: UserApi, topLevel: Boolean, private val timeoutSeconds: Long) : ProxyHandler() { - private val timerID: Long + private lateinit var timerID: Long private var lastAccessed: Long = 0 init { try {