Skip to content

Fix code sample for nested router functions #28603

Closed
@daehwan2yo

Description

@daehwan2yo

Hi,
About nested Routes in Web on Reactive Docs ,
https://docs.spring.io/spring-framework/docs/current/reference/html/web-reactive.html#nested-routes

says
path("/person", builder -> ... .POST("/person", ...)).build();
스크린샷 2022-06-10 오전 11 52 05

it means that API will be POST "/person/person",
however this example is how to construct nest path without duplication so I think it is not RESTful.

스크린샷 2022-06-10 오후 12 04 02

Is this intentional?
if not, how about to update like

RouterFunction<ServerResponse> route = route()
    .path("/person", builder -> builder 
        .GET("/{id}", accept(APPLICATION_JSON), handler::getPerson)
        .GET(accept(APPLICATION_JSON), handler::listPeople)
        .POST("", handler::createPerson))
    .build();

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions