Skip to content

Create DSL for RouterFunction and RouterFunctions [SPR-16953] #21491

@spring-projects-issues

Description

@spring-projects-issues

Arjen Poutsma opened SPR-16953 and commented

We should add a (Java) DSL to org.springframework.web.servlet.function that makes it easier to discover the routing possibilities that all the request predicates offer.

So, instead of writing

RouterFunction routerFunction = route(GET("/pets/{id}", request -> ServerResponse.ok.build())

where both route and GET are statically imported, it should be more discoverable.

For instance, by introducing a builder with methods that directly express common request predicates, eg. routeGET(String, HandlerFunction) instead of route(RequestPredicate, HandlerFunction.


Issue Links:

Referenced from: commits 91e96d8, 8202052

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions