-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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] serializableModel generates "extends" instead of "implements" #17895
Comments
Hi, |
Just reproduced the issue with version 7.4.0. You can use the attached Test-OpenAPI.json to reproduce the issue. With the following call you will get a class $ java -jar openapi-generator-cli-7.4.0.jar generate -i ./Test-OpenAPI.json -g java -o genc --additional-properties library=native,serializableModel=true --invoker-package=de.my.client --model-package=de.my.client.model --api-package=de.my.client.api public class CoreBar extends AbstractOpenApiSchema, Serializable { ... } P.S.: Java version = 21, platform = Windows 10. |
I could break down the problem to this parameter: library=native Without this parameter the generator works correctly. |
Thanks for the clarification. I could reproduce the issue now and created a fix for it. |
Bug Report Checklist
Description
When generating Java code with
serializableModel=true
the result is faulty.expected result:
current result (simplified):
In my case there was already an class from which to extend, so Serializable was just added:
current result:
openapi-generator version
7.3.0 with Java 17 and Java 21
OpenAPI declaration file content or url & Generation Details
Just use any OpenAPI JSON with the following command to generate the Java code:
Steps to reproduce
The text was updated successfully, but these errors were encountered: