Skip to content

RouterFunction ignored when last predicate is not a PathPatternPredicate (detected with Webflux) #1695

Closed
@christophejan

Description

@christophejan

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 :

.GET("", HANDLER_FUNCTION, builder -> builder.operationId("get-users"))

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

  1. As workaround, we can specify an empty string PathPatternPredicate as last RequestPredicate like on the test used to reproduce.
  2. 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) :

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions