springfox: operationId is not guaranteed to be unique

An 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

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 19 (17 by maintainers)

Commits related to this issue

Most upvoted comments

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)