La ruta funcional Spring Web Flux (reactiva) no funciona como se esperaba con Kotlin

Hola buena gente interesada en escribir aplicaciones de spring en Kotlin. Estoy jugando con Spring Boot 2.0.0 snapshot y spring-webflux . Este pedazo de código:

 @Component class TestRouter() : RouterFunction<ServerResponse> { override fun route(request: ServerRequest) = route(request) { "/".route { GET("/hello") { ServerResponse.ok().body(BodyInserters.fromObject("World")) } "/{id}".route { GET("/hello") { ServerResponse.ok().body(BodyInserters.fromObject("World ${request.pathVariable("id")}")) } } } } } 

no funciona como se esperaba (al less como era de esperar :))

 ➜ ~ curl -i http://localhost:8080/hello HTTP/1.1 200 OK transfer-encoding: chunked Content-Type: text/plain;charset=UTF-8 World 

pero:

 ➜ ~ curl -i http://localhost:8080/1/hello HTTP/1.1 404 Not Found content-length: 0 

Trazo del caso de trabajo:

 2017-03-03 00:58:03.865 TRACE 7666 --- [ctor-http-nio-4] oswrfserver.RequestPnetworkingicates : Pattern "//**" matches against value "/hello" 2017-03-03 00:58:03.865 DEBUG 7666 --- [ctor-http-nio-4] oswrfunction.server.RouterFunctions : Nested pnetworkingicate "//**" matches against "GET /hello" 2017-03-03 00:58:03.865 TRACE 7666 --- [ctor-http-nio-4] oswrfserver.RequestPnetworkingicates : Method "GET" matches against value "GET" 2017-03-03 00:58:03.866 TRACE 7666 --- [ctor-http-nio-4] oswrfserver.RequestPnetworkingicates : Pattern "/hello" matches against value "/hello" 2017-03-03 00:58:03.866 DEBUG 7666 --- [ctor-http-nio-4] oswrfunction.server.RouterFunctions : Pnetworkingicate "(GET && /hello)" matches against "GET /hello" 

No traza el caso de trabajo:

 2017-03-03 00:59:26.958 TRACE 7666 --- [ctor-http-nio-1] oswrfserver.RequestPnetworkingicates : Pattern "//**" matches against value "/1/hello" 2017-03-03 00:59:26.958 DEBUG 7666 --- [ctor-http-nio-1] oswrfunction.server.RouterFunctions : Nested pnetworkingicate "//**" matches against "GET /1/hello" 2017-03-03 00:59:26.958 TRACE 7666 --- [ctor-http-nio-1] oswrfserver.RequestPnetworkingicates : Method "GET" matches against value "GET" 2017-03-03 00:59:26.958 TRACE 7666 --- [ctor-http-nio-1] oswrfserver.RequestPnetworkingicates : Pattern "/hello" does not match against value "/1/hello" 2017-03-03 00:59:26.959 TRACE 7666 --- [ctor-http-nio-1] oswrfserver.RequestPnetworkingicates : Pattern "/{id}/**" matches against value "/1/hello" 2017-03-03 00:59:26.959 DEBUG 7666 --- [ctor-http-nio-1] oswrfunction.server.RouterFunctions : Nested pnetworkingicate "/{id}/**" matches against "GET /1/hello" 2017-03-03 00:59:26.959 TRACE 7666 --- [ctor-http-nio-1] oswrfserver.RequestPnetworkingicates : Method "GET" matches against value "GET" 2017-03-03 00:59:26.959 TRACE 7666 --- [ctor-http-nio-1] oswrfserver.RequestPnetworkingicates : Pattern "/hello" does not match against value "/1/hello" 

Esto parece un error (ya que el "/{id}".route {...} supuestamente está usando RouterFunctions.nest), pero podría estar equivocado. Tus pensamientos y ayuda son bienvenidos.

Obviamente sé que puedo hacer /1/hello trabajo simplemente escribiendo GET("/{id}/hello") { ... } , pero estoy interesado en la variante .route { ...} anidada ya que admite mi caso de uso de agregar routes anidadas desde otra location (como un map, etc.).

Este problema ha sido resuelto en SPR-15310 .