Skip to content

API operations without an operationId can share one page URL #4989

Open

Description

@reakaleek

Two operations on the same route with no operationId get the same page URL, so one of them has no page.

What happened

ApiUrlBuilder.OperationMoniker builds a fallback URL from the route when an operation has no operationId. A GET and a POST on the same route then share one URL. When their facets differ, they do not collapse onto one page, so each keeps its own navigation item. OpenApiGenerator.UniquePages keeps the last item for a URL, which makes the other operation's link open the wrong page.

Which operation wins depends on the order of operations in a group. #4988 lists deprecated operations last, so a deprecated operation now wins over a current one on the same route. Before that change, the method order decided the winner. Either way one operation is unreachable.

How to reproduce

A spec with a deprecated GET /things and a current POST /things, neither with an operationId. Both sidebar links open the GET page.

Anything else

A fix could give colliding fallback monikers distinct URLs, for example by adding the method to the loser. Old URLs must keep landing on a page. Raised in review on #4988.

Activity

  1. rahulsjha commented on Nov 21, 2026

    @rahulsjha

    Hi @reakaleek, I'd like to fix this. I'd make ApiUrlBuilder.OperationMoniker include the HTTP method in the fallback URL when there's no operationId, so a GET and a POST on one route get separate pages, with tests. Okay if I take it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions