operationId is not guaranteed to be unique
See original GitHub issueAn example of the naive implementation failing is a definition for request mappings like the following
@RequestMapping(method=RequestMethod.GET, value={"/campaigns","/campaigns/{id}"})
public String getCampaignDetails(Model model,
@RequestParam(value="id", required=false) Long id,
@PathVariable("id") Long id2)
{
}
Another scenario:
@RequestMapping(method=RequestMethod.GET, value={"/campaigns","/campaignsAlias"})
This bug relates to #659
Issue Analytics
- State:
- Created 8 years ago
- Comments:19 (17 by maintainers)
Top Results From Across the Web
Checking uniqueness of OperationId when using c ...
After many tries, I've found a workaround: use an operation filter that will throw an exception if OperationId is already used
Read more >operation-operationId-unique - Redocly
The operationId should be unique (used only once in an OpenAPI definition). This rule is unopinionated.
Read more >Re: The spooled operation id does not exist ERROR
Spooled operation id, request id and activity id are unique in every error. I have no ideas, which row it refers to. How...
Read more >Evolve your API with version control - Microsoft Learn
Each operation has a unique operationId and a unique urlPath and ... deadline where support for the operation is no longer guaranteed.
Read more >Link (MicroProfile OpenAPI API 2.0-RC3 API)
The presence of a link does not guarantee the caller's ability to successfully invoke it ... resolvable OAS operation, as defined with a...
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 Free
Top 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
Hi,
I am using the 2.1.0 Springfox release. I make sure to provide proper meaningful and unique nicknames across all our controllers. So, I really do not want Springfox to add the additional uniqueness strings something like “UsingGET” etc.
The generated operation ids or java code looks like this, If you look at each of the method names, they are already unique and convey meaningful information. I really do not want the Using part to be appended. I agree that in some scenarios it might be helpful when the developers who do not provide nicknames. But if a nickname is provided then, we should definitely leave the responsibility to the users/developers and not override their settings. Or provide any other mechanism to get the name as what I want to.
Rack Controller.
getRacksUsingGET() getRackUsingGET(String) getAlertsUsingGET1(String, String) getSetupConfigUsingGET(String) updateSetupConfigUsingPUT(String, RackConfig) getEventsUsingGET1(String, String) getHostsUsingGET2(String) getIpReAllocationUsingGET(String) rerunIpReAllocationUsingPUT(String) performIpReAllocationUsingPOST(String) cancelIpReAllocationUsingDELETE(String) getSwitchesUsingGET(String)
For anyone wanting to customize
operationId
in their swagger definition: https://stackoverflow.com/questions/38821763/how-to-customize-the-value-of-operationid-generated-in-api-spec-with-swagger