-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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] Model inheritance in Java and Swift is broken in v6.0.0 #12650
Comments
We are facing the same issue for Swift. Is there a chance to get this fixed? |
Hi all, I've filed #14172 to allow using $ref as parent in allOf with a new option called "openapi-normalizer". Please give it a try as follows:
|
Thank you for looking at this, and sorry for the late reply! Since your PR has already been merged I ran
i.e. a base class that can't be inherited from and a derived class that doesn't inherit from anything. Generating Java models actually produces |
@valentin-braun if this is still relevant to you, we've finally decided to build a custom model generator from scratch: https://github.com/onvista-media/modelgen |
Bug Report Checklist
Description
Installed v6.0.0, noticed that base class / derived class relationships no longer show up in generated Java and Swift models.
OpenAPI declaration file content or url
Steps to reproduce
Generate models using
openapi-generator generate -i spec.yml -g java
andopenapi-generator generate -i spec.yml -g swift5 --additional-properties=useClasses=true
The resulting Java code for
DerivedClass
looks like this:and the Swift version has
i.e. in both cases, information about the inheritance is lost.
In the Swift case, the base class is erroneously generated as
final
,which prohibits inheriance, even if the code for
DerivedClass
were generated correctly.The text was updated successfully, but these errors were encountered: