【发布时间】:2020-10-22 22:50:16
【问题描述】:
我将 springdoc-openapi 与 Kotlin 和 WebFlux.fn 一起使用。
我想在 CoRouterFunctionDsl 中的每个路径上使用 @RouterOperation 注释,但我不能。
@Configuration
class UserRouter(private val userHandler: UserHandler) {
// @RouterOperations annotation works here.
@Bean
fun userRouter = coRouter {
("/v1").nest {
// I want to use @RouterOperation annotation here.
GET("/users", userHandler::getUsers)
// I want to use @RouterOperation annotation here.
GET("/users/{userId}", userHandler::getUserById)
// I want to use @RouterOperation annotation here.
POST("/users", userHandler::postUser)
}
}
}
似乎没有任何相关文档。
如何在 coRouter DSL 中使用 @RouterOperation?
【问题讨论】:
标签: kotlin spring-webflux springdoc springdoc-openapi-ui