Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
AlexanderSchuetz97 opened this issue Nov 8, 2024 · 3 comments

Comments

@AlexanderSchuetz97
Copy link

AlexanderSchuetz97 commented Nov 8, 2024

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.

@devhl-labs
Copy link
Contributor

Fixed by #19913

@wing328
Copy link
Member

wing328 commented Nov 12, 2024

https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.10.0-SNAPSHOT/

please give it a try with the latest snapshot version

happy to reopen if it's still an issue

@wing328 wing328 closed this as completed Nov 12, 2024
@AlexanderSchuetz97
Copy link
Author

Snapshot did work. Could you cut a release soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants