You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
Our spec used to generated data classes, but now it generates classes without the data keyword. This happens when I have a component that has a allOf with a $ref to a supertype and no extra properties. When I have a component that has a allOf with a $ref to a supertype and an extra property it does generate a data class.
This seems to be originating from #19526 . The variable hasVars is true only when the generated class has properties and does not consider the base class properties.
I have the same issue when updating to 7.9.0. Before, the generator created data classes implementing an interface, but now it outputs simple classes. This causes problems, e.g. in tests, that were using the default field-based equals method to compare instances, which are now compared by identity and make the assertions fail.
I am not that deep into the OpenAPI spec and the generator. I can look at it again, but for now I think replacing the hasVars variable from #19526 with a check if the allVars is empty would solve the issue. I do not have enough experience with both to come up with edge cases for now.
Bug Report Checklist
Description
Our spec used to generated data classes, but now it generates classes without the data keyword. This happens when I have a component that has a
allOf
with a$ref
to a supertype and no extra properties. When I have a component that has aallOf
with a$ref
to a supertype and an extra property it does generate a data class.openapi-generator version
Broken in 7.9.0, it did work in 7.8.0
OpenAPI declaration file content or url
AssetWithDataClass now generates a data class. AssetWithoutDataClass does not generate a data class anymore, but it did in 7.8.0.
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered: