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
Since charges, listCharges, and retailCharges are all defined as using the same Charges schema, I expect to see only a single struct generated for the Charges schema with a single batch of set/get/etc accessors and an OptCharges wrapper for optionality
What did you see instead?
I see a bunch of unnecessarily-repeated identical structs and accessors for ResultCharges, ResultListCharges, ResultRetailCharges, and all their nested elements, and all their nested accessor methods, that all implement the same schemas but which are named after the attribute name.
Workaround?
If properties are defined as (openapi 3.1 style equivalent)
fiendish
changed the title
code generation: Reused struct gets generated multiple times with different names when not appropriate
code generation: Reused schema gets generated to struct multiple times with different names when not appropriate
Oct 31, 2024
What version of ogen are you using?
v1.6.0
Can this issue be reproduced with the latest version?
Yes
What did you do?
With an OpenAPI spec schema that looks like (trimmed down for clarity):
What did you expect to see?
Since charges, listCharges, and retailCharges are all defined as using the same Charges schema, I expect to see only a single struct generated for the Charges schema with a single batch of set/get/etc accessors and an OptCharges wrapper for optionality
What did you see instead?
I see a bunch of unnecessarily-repeated identical structs and accessors for ResultCharges, ResultListCharges, ResultRetailCharges, and all their nested elements, and all their nested accessor methods, that all implement the same schemas but which are named after the attribute name.
Workaround?
If properties are defined as (openapi 3.1 style equivalent)
Then this doesn't happen and things look as expected.
The text was updated successfully, but these errors were encountered: