Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Kotlin DSL for functional routes #1155

Merged
merged 1 commit into from
May 17, 2021

Conversation

jonasws
Copy link

@jonasws jonasws commented May 6, 2021

This PR adds a DSL matching that of org.springframework.web.reactive.function.server.RouterFunctionDsl to allow users to define operations inline when using functional routes, like (imports omitted for brevity):

@Configuration
class RouterConfig {
    @Bean
    fun appRouter(clientHandler: ClientHandler) = docRouter {
        GET(
            "/clients//{clientName}",
            clientHandler::getClientByName
        ) {
            it.beanClass(ClientService::class.java).beanMethod("getClient")
                .parameter(Builder.parameterBuilder().name("clientName"))
        }
    }
}

This has been adressed earlier as well, in #967

Copy link
Contributor

@bnasslahsen bnasslahsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jonasws for your contribution.

@bnasslahsen bnasslahsen merged commit 800bd8d into springdoc:master May 17, 2021
@bnasslahsen bnasslahsen added the enhancement New feature or request label Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants