Skip to content

[BUG] Operations with multiple Tags triggers "unique" operation id generator which appends _0 to operation names. #20066

@AlexanderSchuetz97

Description

@AlexanderSchuetz97

I use the Java Native client generator.

I have a operation with 2 tags.
This did work as expected with the method being generated in both "client" files for openapi generator version 7.8.0

When using openapi generator 7.9.0 with the exact same schema file this adds _0 to the code which causes it to no longer compile.
The operation id is actually unique in the file.

My analysis of the Bug:

The Bug appears to occur in:
org.openapitools.codegen.DefaultCodegen#addOperationToGroup

There is a
in line 5713 there is this: seenOperationIds.put(co.operationId, counter);

which gets called from DefaultGenerator#processOperations line 1586.
This line is in a for loop over all tags.

This can be fixed if the seenOperationsIds prepend the "tag" to the seen operation ids.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions