Closed
Description
Describe the bug
Currently, when the last RequestPredicate of a RouterFunction is not a PathPatternPredicate, the RouterFunction is ignored by Springdoc (detected with Webflux).
To Reproduce
Use SpringDocApp150Test after removing the empty string pattern for the get-users
GET
operation.
IE replace :
with the following line :
.GET(HANDLER_FUNCTION, builder -> builder.operationId("get-users"))
Current result : the get-users
route is then missing from the resulting API documentation
Expected behavior
The RouterFunction should be present in the API documentation even in that usecase.
Additional context
- As workaround, we can specify an empty string PathPatternPredicate as last RequestPredicate like on the test used to reproduce.
- I think the current behavior is due to AbstractRouterFunctionVisitor. I think that part of the logic present in the following
if
block of code (i.e. calls to createRouterFunctionData method) should be moved to commonRoute method (it will not be easy) :