Skip to content

Wrong operationid generated #675

Closed
Closed
@tezine

Description

@tezine

Hello,
This bug is probably the same as bug 96.
OperationID continues to be generated with a suffix, even when there's no other method with the same operationid in the same class.

This issue is easy to reproduce:

  1. Create two controllers classes.
  2. Create one method with the same name in both classes.
  3. http://yoursite/v3/api-docs will produce one operationid correct and the other will have the 1 suffix.

Ex:
MyFirstClass.java:

    @Operation(operationId = "save")
    @PostMapping(path = "/")
    @ApiResponse(responseCode = "200", description = "Success")
    public ResponseEntity save(@RequestBody String request) {
      return null;
    }
MySecondClass.java:
    @Operation(operationId = "save")
    @PostMapping(path = "/")
    @ApiResponse(responseCode = "200", description = "Success")
    public ResponseEntity save(@RequestBody String request) {
      return null;
    }

After generation, one method will have the correct operationid (save), but the other one will have a wrong operationid(save_1)
This bug is happening with SpringDoc 1.3.0, SpringBoot 2.2.6, openJDK 11 64bits on Windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions