OperantionId may be duplicated
See original GitHub issueNow a days operationId is generated based on the endpoint method name. So when you have two methods with the same name (even in different classes) it causes a conflict in the swagger.json file.
For example:
@ApiOperation(value = "Just testing")
@Path("test-one")
public class Test {
@GET
@Path("test")
public Response test() {
return Response.ok().build();
}
}
@ApiOperation(value = "Testing...")
@Path("test-two")
public class Test2 {
@GET
@Path("another-test")
public Response test() {
return Response.ok().build();
}
}
The operationId property in the final file will be test
for both endpoints.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:11 (2 by maintainers)
Top Results From Across the Web
2.3 Duplicate Cases Found Alert - E-Verify
A Duplicate Cases Found alert appears for a case that contains information found in one or more cases created within the last 365...
Read more >Duplication of Output Spool Entries - IBM
a duplicate itself may be duplicated; each duplicate can be separately manipulated or displayed; allows to fan out one output entry to different...
Read more >Find and remove duplicates - Microsoft Support
Select the cells you want to check for duplicates. Note: Excel can't highlight duplicates in the Values area of a PivotTable report. Click...
Read more >Rule 1003. Admissibility of Duplicates - Law.Cornell.Edu
A duplicate is admissible to the same extent as the original unless a genuine ... may be present when only a part of...
Read more >Duplicate Content: Why does it happen and how to fix issues
This occurs when each user that visits a website is assigned a different session ID that is stored in the URL. Session ids...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@larsf
I solved this problem with a filterClass
This change cause swagger-codegen to generate methods that now have “arbitrary” numbers in the name. So in stead of being able to call “endpoint”.delete(), depending on how many endpoints you have, it may be endpoint.delete_1(), or endpoint.delete_100(). When you allowed for the operationId to simply be equal to the method name, the api calls were consistent like this: firstEndpoint.delete() and secondEndpoint.delete(), instead of now being firstEndpoint.delete_1(), and secondEndpoint.delete_2()
Is there a way to override this auto numbering, and revert to the old behavior?