-
-
Notifications
You must be signed in to change notification settings - Fork 227
Fix(parser): reference type resolution (fix #371) #418
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
Fix(parser): reference type resolution (fix #371) #418
Conversation
Codecov Report
@@ Coverage Diff @@
## main #418 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 47 47
Lines 1549 1546 -3
=========================================
- Hits 1549 1546 -3
Continue to review full report at Codecov.
|
0321209
to
5ac6881
Compare
5ac6881
to
612384c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, this is great! I figured it would be a lot more work to implement which is why I put it off so long. Thanks for contributing this! 🥳
There was an error with the e2e test once I merged in main so I recreated in #425 and simplified the e2e generated test by making all properties required (so there will be less churn). |
][#425]. Thanks @p1-ra! * parser / properties / do not restrict reference pointer type to `enum` or `object` * e2e / update `openapi.json` and golden-record * tpl / model / add missing typing import: `Tuple,Optional,BinaryIO,TextIO` * test: Make big ref test model properties required to lessen generated code Co-authored-by: Nementon <[email protected]>
…-generators#371][openapi-generators#418][openapi-generators#425]. Thanks @p1-ra! * parser / properties / do not restrict reference pointer type to `enum` or `object` * e2e / update `openapi.json` and golden-record * tpl / model / add missing typing import: `Tuple,Optional,BinaryIO,TextIO` * test: Make big ref test model properties required to lessen generated code Co-authored-by: Nementon <[email protected]>
This PR resolve #371
The parser assumed that a reference was always pointing to an enum (EnumProperty) or to an object (ModelProperty).
It was defaulting to a ModelProperty, thus when a reference was pointing to an other kind of property (StringProperty, DateProperty, FileProperty, etc) a model was generated.
It now correctly resolve the Property type in function of the schema type.
BR.