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
I had some code that used to work on 5.4.0 and now it doesn't. I traced the issue down to some change in the implementation of the usage of oneOf, where previously swagger::OneOf<A,B> was generated, now a new model is generated, but that new model is empty.
It seems that generating intermediate models for nested properties is a good idea, just that there should probably be some heuristic to detect when the nested type is a oneOf and use a different path.
The text was updated successfully, but these errors were encountered:
While #13970 and #17915 have fixed it for the client side, rust-server is still broken for me. #9497 also only faces client-side code from what I can see.
@mirosval should we change this issue title to include rust-server specifically?
mirosval
changed the title
[BUG] Code generation is broken for oneOf types
[BUG] Code generation is broken for oneOf types (Rust Server)
Apr 9, 2024
Bug Report Checklist
Description
I had some code that used to work on 5.4.0 and now it doesn't. I traced the issue down to some change in the implementation of the usage of
oneOf
, where previouslyswagger::OneOf<A,B>
was generated, now a new model is generated, but that new model is empty.https://gist.github.com/mirosval/433308deb22727e3b1102fb58f3a6652
openapi-generator version
Works on 5.4.0 and does not since 6.0.
OpenAPI declaration file content or url
I'll provide a full gist, but shortly these are the interesting bits:
Before:
After:
Generation Details
Steps to reproduce
See the Gist and then
make generate-540 generate-710 generate-latest
Related issues/PRs
This looks like it might be related:
#13538
Suggest a fix
It seems that generating intermediate models for nested properties is a good idea, just that there should probably be some heuristic to detect when the nested type is a
oneOf
and use a different path.The text was updated successfully, but these errors were encountered: