diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/exceptions.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/exceptions.mustache index 339e5d08e617a..2a133d99d9e4f 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/exceptions.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/exceptions.mustache @@ -1,5 +1,6 @@ package {{apiPackage}} +import org.springframework.context.annotation.Configuration import org.springframework.http.HttpStatus import org.springframework.web.bind.annotation.ControllerAdvice import org.springframework.web.bind.annotation.ExceptionHandler @@ -11,7 +12,7 @@ sealed class ApiException(msg: String, val code: Int) : Exception(msg) class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) - +@Configuration("{{apiPackage}}.DefaultExceptionHandler") @ControllerAdvice class DefaultExceptionHandler { diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/Exceptions.kt index 44190af7a019c..901db1237ee7e 100644 --- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/Exceptions.kt +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -1,5 +1,6 @@ package org.openapitools.api +import org.springframework.context.annotation.Configuration import org.springframework.http.HttpStatus import org.springframework.web.bind.annotation.ControllerAdvice import org.springframework.web.bind.annotation.ExceptionHandler @@ -11,7 +12,7 @@ sealed class ApiException(msg: String, val code: Int) : Exception(msg) class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) - +@Configuration("org.openapitools.api.DefaultExceptionHandler") @ControllerAdvice class DefaultExceptionHandler { diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/Exceptions.kt index 117161bf65b15..1bd78f54576a7 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/Exceptions.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -1,5 +1,6 @@ package org.openapitools.api +import org.springframework.context.annotation.Configuration import org.springframework.http.HttpStatus import org.springframework.web.bind.annotation.ControllerAdvice import org.springframework.web.bind.annotation.ExceptionHandler @@ -11,7 +12,7 @@ sealed class ApiException(msg: String, val code: Int) : Exception(msg) class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) - +@Configuration("org.openapitools.api.DefaultExceptionHandler") @ControllerAdvice class DefaultExceptionHandler { diff --git a/samples/server/petstore/kotlin-springboot-bigdecimal-default/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot-bigdecimal-default/src/main/kotlin/org/openapitools/api/Exceptions.kt index 44190af7a019c..901db1237ee7e 100644 --- a/samples/server/petstore/kotlin-springboot-bigdecimal-default/src/main/kotlin/org/openapitools/api/Exceptions.kt +++ b/samples/server/petstore/kotlin-springboot-bigdecimal-default/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -1,5 +1,6 @@ package org.openapitools.api +import org.springframework.context.annotation.Configuration import org.springframework.http.HttpStatus import org.springframework.web.bind.annotation.ControllerAdvice import org.springframework.web.bind.annotation.ExceptionHandler @@ -11,7 +12,7 @@ sealed class ApiException(msg: String, val code: Int) : Exception(msg) class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) - +@Configuration("org.openapitools.api.DefaultExceptionHandler") @ControllerAdvice class DefaultExceptionHandler { diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/Exceptions.kt index 117161bf65b15..1bd78f54576a7 100644 --- a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/Exceptions.kt +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -1,5 +1,6 @@ package org.openapitools.api +import org.springframework.context.annotation.Configuration import org.springframework.http.HttpStatus import org.springframework.web.bind.annotation.ControllerAdvice import org.springframework.web.bind.annotation.ExceptionHandler @@ -11,7 +12,7 @@ sealed class ApiException(msg: String, val code: Int) : Exception(msg) class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) - +@Configuration("org.openapitools.api.DefaultExceptionHandler") @ControllerAdvice class DefaultExceptionHandler { diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/Exceptions.kt index 44190af7a019c..901db1237ee7e 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/Exceptions.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -1,5 +1,6 @@ package org.openapitools.api +import org.springframework.context.annotation.Configuration import org.springframework.http.HttpStatus import org.springframework.web.bind.annotation.ControllerAdvice import org.springframework.web.bind.annotation.ExceptionHandler @@ -11,7 +12,7 @@ sealed class ApiException(msg: String, val code: Int) : Exception(msg) class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) - +@Configuration("org.openapitools.api.DefaultExceptionHandler") @ControllerAdvice class DefaultExceptionHandler { diff --git a/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/api/Exceptions.kt index 117161bf65b15..1bd78f54576a7 100644 --- a/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/api/Exceptions.kt +++ b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -1,5 +1,6 @@ package org.openapitools.api +import org.springframework.context.annotation.Configuration import org.springframework.http.HttpStatus import org.springframework.web.bind.annotation.ControllerAdvice import org.springframework.web.bind.annotation.ExceptionHandler @@ -11,7 +12,7 @@ sealed class ApiException(msg: String, val code: Int) : Exception(msg) class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) - +@Configuration("org.openapitools.api.DefaultExceptionHandler") @ControllerAdvice class DefaultExceptionHandler { diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/Exceptions.kt index 44190af7a019c..901db1237ee7e 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/Exceptions.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -1,5 +1,6 @@ package org.openapitools.api +import org.springframework.context.annotation.Configuration import org.springframework.http.HttpStatus import org.springframework.web.bind.annotation.ControllerAdvice import org.springframework.web.bind.annotation.ExceptionHandler @@ -11,7 +12,7 @@ sealed class ApiException(msg: String, val code: Int) : Exception(msg) class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) - +@Configuration("org.openapitools.api.DefaultExceptionHandler") @ControllerAdvice class DefaultExceptionHandler { diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/Exceptions.kt index 44190af7a019c..901db1237ee7e 100644 --- a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/Exceptions.kt +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -1,5 +1,6 @@ package org.openapitools.api +import org.springframework.context.annotation.Configuration import org.springframework.http.HttpStatus import org.springframework.web.bind.annotation.ControllerAdvice import org.springframework.web.bind.annotation.ExceptionHandler @@ -11,7 +12,7 @@ sealed class ApiException(msg: String, val code: Int) : Exception(msg) class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) - +@Configuration("org.openapitools.api.DefaultExceptionHandler") @ControllerAdvice class DefaultExceptionHandler { diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/Exceptions.kt index 117161bf65b15..1bd78f54576a7 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/Exceptions.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -1,5 +1,6 @@ package org.openapitools.api +import org.springframework.context.annotation.Configuration import org.springframework.http.HttpStatus import org.springframework.web.bind.annotation.ControllerAdvice import org.springframework.web.bind.annotation.ExceptionHandler @@ -11,7 +12,7 @@ sealed class ApiException(msg: String, val code: Int) : Exception(msg) class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) - +@Configuration("org.openapitools.api.DefaultExceptionHandler") @ControllerAdvice class DefaultExceptionHandler { diff --git a/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/api/Exceptions.kt index 117161bf65b15..1bd78f54576a7 100644 --- a/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/api/Exceptions.kt +++ b/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -1,5 +1,6 @@ package org.openapitools.api +import org.springframework.context.annotation.Configuration import org.springframework.http.HttpStatus import org.springframework.web.bind.annotation.ControllerAdvice import org.springframework.web.bind.annotation.ExceptionHandler @@ -11,7 +12,7 @@ sealed class ApiException(msg: String, val code: Int) : Exception(msg) class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) - +@Configuration("org.openapitools.api.DefaultExceptionHandler") @ControllerAdvice class DefaultExceptionHandler { diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/Exceptions.kt index 44190af7a019c..901db1237ee7e 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/Exceptions.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -1,5 +1,6 @@ package org.openapitools.api +import org.springframework.context.annotation.Configuration import org.springframework.http.HttpStatus import org.springframework.web.bind.annotation.ControllerAdvice import org.springframework.web.bind.annotation.ExceptionHandler @@ -11,7 +12,7 @@ sealed class ApiException(msg: String, val code: Int) : Exception(msg) class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) - +@Configuration("org.openapitools.api.DefaultExceptionHandler") @ControllerAdvice class DefaultExceptionHandler { diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/Exceptions.kt index 44190af7a019c..901db1237ee7e 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/Exceptions.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -1,5 +1,6 @@ package org.openapitools.api +import org.springframework.context.annotation.Configuration import org.springframework.http.HttpStatus import org.springframework.web.bind.annotation.ControllerAdvice import org.springframework.web.bind.annotation.ExceptionHandler @@ -11,7 +12,7 @@ sealed class ApiException(msg: String, val code: Int) : Exception(msg) class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) - +@Configuration("org.openapitools.api.DefaultExceptionHandler") @ControllerAdvice class DefaultExceptionHandler { diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/Exceptions.kt index 44190af7a019c..901db1237ee7e 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/Exceptions.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -1,5 +1,6 @@ package org.openapitools.api +import org.springframework.context.annotation.Configuration import org.springframework.http.HttpStatus import org.springframework.web.bind.annotation.ControllerAdvice import org.springframework.web.bind.annotation.ExceptionHandler @@ -11,7 +12,7 @@ sealed class ApiException(msg: String, val code: Int) : Exception(msg) class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) - +@Configuration("org.openapitools.api.DefaultExceptionHandler") @ControllerAdvice class DefaultExceptionHandler { diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/Exceptions.kt index 44190af7a019c..901db1237ee7e 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/Exceptions.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -1,5 +1,6 @@ package org.openapitools.api +import org.springframework.context.annotation.Configuration import org.springframework.http.HttpStatus import org.springframework.web.bind.annotation.ControllerAdvice import org.springframework.web.bind.annotation.ExceptionHandler @@ -11,7 +12,7 @@ sealed class ApiException(msg: String, val code: Int) : Exception(msg) class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) - +@Configuration("org.openapitools.api.DefaultExceptionHandler") @ControllerAdvice class DefaultExceptionHandler {