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

Fix code sample for nested router functions #28603

Closed
daehwan2yo opened this issue Jun 10, 2022 · 1 comment
Closed

Fix code sample for nested router functions #28603

daehwan2yo opened this issue Jun 10, 2022 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: documentation A documentation task
Milestone

Comments

@daehwan2yo
Copy link

daehwan2yo commented Jun 10, 2022

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();
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 10, 2022
@poutsma poutsma self-assigned this Jun 10, 2022
@poutsma poutsma added in: web Issues in web modules (web, webmvc, webflux, websocket) type: documentation A documentation task and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jun 10, 2022
@poutsma poutsma changed the title Documentation has nested error need to be updated for WebFlux Fix code sample for nested router functions Jun 10, 2022
@poutsma
Copy link
Contributor

poutsma commented Jun 10, 2022

Thanks for spotting this. It seems like the Servlet version has the same issue.

@poutsma poutsma added this to the 5.3.21 milestone Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

3 participants