diff --git a/framework-docs/src/docs/asciidoc/web/webflux-functional.adoc b/framework-docs/src/docs/asciidoc/web/webflux-functional.adoc index 7f02a004ab..30970068d7 100644 --- a/framework-docs/src/docs/asciidoc/web/webflux-functional.adoc +++ b/framework-docs/src/docs/asciidoc/web/webflux-functional.adoc @@ -640,7 +640,7 @@ RouterFunction route = route() [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"] .Kotlin ---- - val route = coRouter { + val route = coRouter { // <1> "/person".nest { GET("/{id}", accept(APPLICATION_JSON), handler::getPerson) GET(accept(APPLICATION_JSON), handler::listPeople) @@ -648,6 +648,7 @@ RouterFunction route = route() } } ---- +<1> Create router using Coroutines router DSL; a Reactive alternative is also available via `router { }`. Though path-based nesting is the most common, you can nest on any kind of predicate by using the `nest` method on the builder. diff --git a/framework-docs/src/docs/asciidoc/web/webmvc-functional.adoc b/framework-docs/src/docs/asciidoc/web/webmvc-functional.adoc index 11fb793d4f..828be373ae 100644 --- a/framework-docs/src/docs/asciidoc/web/webmvc-functional.adoc +++ b/framework-docs/src/docs/asciidoc/web/webmvc-functional.adoc @@ -623,13 +623,14 @@ RouterFunction route = route() import org.springframework.web.servlet.function.router val route = router { - "/person".nest { + "/person".nest { // <1> GET("/{id}", accept(APPLICATION_JSON), handler::getPerson) GET(accept(APPLICATION_JSON), handler::listPeople) POST(handler::createPerson) } } ---- +<1> Using `nest` DSL. Though path-based nesting is the most common, you can nest on any kind of predicate by using the `nest` method on the builder.