Fix(parser): reference type resolution (fix #371)#418
Fix(parser): reference type resolution (fix #371)#418p1-ra wants to merge 3 commits intoopenapi-generators:mainfrom
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
dbanty
left a comment
There was a problem hiding this comment.
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.