-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
allOf Inheritance is broken in schema with more than two layers hierarchy #4423
Comments
After attempting a migration from swagger-codegen 2.x I hit this yesterday morning and have been scratching my head ever since. I concluded that its a bug worth reporting and discovered that one was raised just 2h earlier! Applying the problem to the petstore examples, I created a
Under swagger-codegen 2.3.1, 2.4.9,
and
Whereas under openapi-generator (master)
and
Not sure whether this ever worked in openapi-generator but it's certainly a regression since forking. Also odd: openapi-generator generates additional |
... and researching further it appears this might be the same as previously reported variants:
None of these seem to have any activity or even acknowledgement 😞. Is there any chance of this regression being addressed @wing328? Or can somebody offer guidance or some starting points on what the fix might be? |
@wing328, could you please take a look on this issue and the provided PR? |
Fixed by #4503 please evaluate and let us know if it needs to be reopened. |
Bug Report Checklist
Description
In schema hierarchy with more, than two layers by Code Generation all classes in parent classes tree are merged within child class.
For example, if you try to generate a model classes from SchemaC, which allOfs SchemaB (with discrimanator), and SchemaB (with discrimanator) allofs SchemaA (with discrimanator), you will get Java class SchemaC, which contains all attributes of SchemaC, SchemaB and SchemaA instead of extending class SchemaB. SchemaC does not extend any class at all. Could you please solve this issue. Some example code is down there (without root yaml file)
openapi-generator version
4.4.2
OpenAPI declaration file content or url
The text was updated successfully, but these errors were encountered: