Skip to content

Same operationId for overloaded methods using Groups breaks swagger-ui collapsibles #399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stefan-huettemann opened this issue Feb 2, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@stefan-huettemann
Copy link

Hi,

Problem

the operationId is used in swagger to define the collapsibles (doc-expansion).

With overloaded methods like, e.g.:

 public ResponseEntity<?> get(String a) {...}

 public ResponseEntity<?> get(String a, Object b) {...}

both services have the same operationId attribute (here: operationId: "get")

This breaks the swagger-ui doc-expansion functionality.

Workaround

Setting a unique operationId in @Operation annotation resolves the problem, but .. I would still consider the behavior a bug (probably with an easy solution).

Solution

I couldn't find the issue by reading the code to provide a solution. There seems to be some code to avoid conflicts in operationIds but ... it should be easy to reproduce the problem (and probably fix it by using a unique id; maybe a UUID would help?).

Thanks.

Regards,
-Stefan

@bnasslahsen
Copy link
Collaborator

Hi @stefan-huettemann,

You need to specify that this issue happens while using Groups.
I confirm its reproducible and will be fixed for the next release.

@bnasslahsen bnasslahsen changed the title Same operationId for overloaded methods breaks swagger-ui collapsibles Same operationId for overloaded methods using Groups breaks swagger-ui collapsibles Feb 2, 2020
@bnasslahsen bnasslahsen added the bug Something isn't working label Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants