-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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][JAVA] oneOf/anyOf multiple constructors with same erasure #18548
Labels
Comments
Bethibande
added a commit
to Bethibande/openapi-generator
that referenced
this issue
May 12, 2024
Bethibande
added a commit
to Bethibande/openapi-generator
that referenced
this issue
May 12, 2024
5 tasks
wing328
pushed a commit
that referenced
this issue
May 13, 2024
Closed since the PR has been merged. |
renatomameli
pushed a commit
to renatomameli/openapi-generator
that referenced
this issue
May 17, 2024
…PITools#18548 (OpenAPITools#18645) * [BUG][JAVA] oneOf/anyOf multiple constructors with same erasure OpenAPITools#18548 * [BUG][JAVA] oneOf/anyOf multiple constructors with same erasure OpenAPITools#18548
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report Checklist
Description
When using the okhttp-gson library, multiple constructors with the same erasure can be generated.
This leads to compiler errors since these constructors are identical.
Gradle logs:
https://gist.github.com/Bethibande/9582795e2e1fd47695019d8f1c685a8b
openapi-generator version
latest/master
Suggest a fix
This is the current constructor generation of the okhttp-gson oneof model template
Change it to:
The setActualInstance method also always takes Object as a parameter, it also validates the given object, so this should be fine, this also shouldn't break any existing code.
In this case, it might also be a good idea to add some documentation about the types of parameters the constructor actually expects.
The text was updated successfully, but these errors were encountered: