forked from loafle/openapi-generator-original
fix kotlin spring boot configuration conflict (#19515)
This commit is contained in:
parent
8511a533d6
commit
0026e15030
@ -1,5 +1,6 @@
|
|||||||
package {{apiPackage}}
|
package {{apiPackage}}
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.http.HttpStatus
|
import org.springframework.http.HttpStatus
|
||||||
import org.springframework.web.bind.annotation.ControllerAdvice
|
import org.springframework.web.bind.annotation.ControllerAdvice
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler
|
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)
|
class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code)
|
||||||
|
|
||||||
|
@Configuration("{{apiPackage}}.DefaultExceptionHandler")
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
class DefaultExceptionHandler {
|
class DefaultExceptionHandler {
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.openapitools.api
|
package org.openapitools.api
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.http.HttpStatus
|
import org.springframework.http.HttpStatus
|
||||||
import org.springframework.web.bind.annotation.ControllerAdvice
|
import org.springframework.web.bind.annotation.ControllerAdvice
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler
|
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)
|
class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code)
|
||||||
|
|
||||||
|
@Configuration("org.openapitools.api.DefaultExceptionHandler")
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
class DefaultExceptionHandler {
|
class DefaultExceptionHandler {
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.openapitools.api
|
package org.openapitools.api
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.http.HttpStatus
|
import org.springframework.http.HttpStatus
|
||||||
import org.springframework.web.bind.annotation.ControllerAdvice
|
import org.springframework.web.bind.annotation.ControllerAdvice
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler
|
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)
|
class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code)
|
||||||
|
|
||||||
|
@Configuration("org.openapitools.api.DefaultExceptionHandler")
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
class DefaultExceptionHandler {
|
class DefaultExceptionHandler {
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.openapitools.api
|
package org.openapitools.api
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.http.HttpStatus
|
import org.springframework.http.HttpStatus
|
||||||
import org.springframework.web.bind.annotation.ControllerAdvice
|
import org.springframework.web.bind.annotation.ControllerAdvice
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler
|
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)
|
class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code)
|
||||||
|
|
||||||
|
@Configuration("org.openapitools.api.DefaultExceptionHandler")
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
class DefaultExceptionHandler {
|
class DefaultExceptionHandler {
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.openapitools.api
|
package org.openapitools.api
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.http.HttpStatus
|
import org.springframework.http.HttpStatus
|
||||||
import org.springframework.web.bind.annotation.ControllerAdvice
|
import org.springframework.web.bind.annotation.ControllerAdvice
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler
|
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)
|
class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code)
|
||||||
|
|
||||||
|
@Configuration("org.openapitools.api.DefaultExceptionHandler")
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
class DefaultExceptionHandler {
|
class DefaultExceptionHandler {
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.openapitools.api
|
package org.openapitools.api
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.http.HttpStatus
|
import org.springframework.http.HttpStatus
|
||||||
import org.springframework.web.bind.annotation.ControllerAdvice
|
import org.springframework.web.bind.annotation.ControllerAdvice
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler
|
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)
|
class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code)
|
||||||
|
|
||||||
|
@Configuration("org.openapitools.api.DefaultExceptionHandler")
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
class DefaultExceptionHandler {
|
class DefaultExceptionHandler {
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.openapitools.api
|
package org.openapitools.api
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.http.HttpStatus
|
import org.springframework.http.HttpStatus
|
||||||
import org.springframework.web.bind.annotation.ControllerAdvice
|
import org.springframework.web.bind.annotation.ControllerAdvice
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler
|
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)
|
class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code)
|
||||||
|
|
||||||
|
@Configuration("org.openapitools.api.DefaultExceptionHandler")
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
class DefaultExceptionHandler {
|
class DefaultExceptionHandler {
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.openapitools.api
|
package org.openapitools.api
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.http.HttpStatus
|
import org.springframework.http.HttpStatus
|
||||||
import org.springframework.web.bind.annotation.ControllerAdvice
|
import org.springframework.web.bind.annotation.ControllerAdvice
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler
|
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)
|
class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code)
|
||||||
|
|
||||||
|
@Configuration("org.openapitools.api.DefaultExceptionHandler")
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
class DefaultExceptionHandler {
|
class DefaultExceptionHandler {
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.openapitools.api
|
package org.openapitools.api
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.http.HttpStatus
|
import org.springframework.http.HttpStatus
|
||||||
import org.springframework.web.bind.annotation.ControllerAdvice
|
import org.springframework.web.bind.annotation.ControllerAdvice
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler
|
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)
|
class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code)
|
||||||
|
|
||||||
|
@Configuration("org.openapitools.api.DefaultExceptionHandler")
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
class DefaultExceptionHandler {
|
class DefaultExceptionHandler {
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.openapitools.api
|
package org.openapitools.api
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.http.HttpStatus
|
import org.springframework.http.HttpStatus
|
||||||
import org.springframework.web.bind.annotation.ControllerAdvice
|
import org.springframework.web.bind.annotation.ControllerAdvice
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler
|
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)
|
class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code)
|
||||||
|
|
||||||
|
@Configuration("org.openapitools.api.DefaultExceptionHandler")
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
class DefaultExceptionHandler {
|
class DefaultExceptionHandler {
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.openapitools.api
|
package org.openapitools.api
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.http.HttpStatus
|
import org.springframework.http.HttpStatus
|
||||||
import org.springframework.web.bind.annotation.ControllerAdvice
|
import org.springframework.web.bind.annotation.ControllerAdvice
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler
|
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)
|
class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code)
|
||||||
|
|
||||||
|
@Configuration("org.openapitools.api.DefaultExceptionHandler")
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
class DefaultExceptionHandler {
|
class DefaultExceptionHandler {
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.openapitools.api
|
package org.openapitools.api
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.http.HttpStatus
|
import org.springframework.http.HttpStatus
|
||||||
import org.springframework.web.bind.annotation.ControllerAdvice
|
import org.springframework.web.bind.annotation.ControllerAdvice
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler
|
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)
|
class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code)
|
||||||
|
|
||||||
|
@Configuration("org.openapitools.api.DefaultExceptionHandler")
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
class DefaultExceptionHandler {
|
class DefaultExceptionHandler {
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.openapitools.api
|
package org.openapitools.api
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.http.HttpStatus
|
import org.springframework.http.HttpStatus
|
||||||
import org.springframework.web.bind.annotation.ControllerAdvice
|
import org.springframework.web.bind.annotation.ControllerAdvice
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler
|
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)
|
class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code)
|
||||||
|
|
||||||
|
@Configuration("org.openapitools.api.DefaultExceptionHandler")
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
class DefaultExceptionHandler {
|
class DefaultExceptionHandler {
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.openapitools.api
|
package org.openapitools.api
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.http.HttpStatus
|
import org.springframework.http.HttpStatus
|
||||||
import org.springframework.web.bind.annotation.ControllerAdvice
|
import org.springframework.web.bind.annotation.ControllerAdvice
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler
|
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)
|
class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code)
|
||||||
|
|
||||||
|
@Configuration("org.openapitools.api.DefaultExceptionHandler")
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
class DefaultExceptionHandler {
|
class DefaultExceptionHandler {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user