-
-
Notifications
You must be signed in to change notification settings - Fork 228
Fix deserialization of optional nullable properties #420
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 deserialization of optional nullable properties #420
Conversation
Codecov Report
@@ Coverage Diff @@
## main #420 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 47 47
Lines 1549 1549
=========================================
Hits 1549 1549 Continue to review full report at Codecov.
|
not_required_nullable_model: Union[Unset, None, ModelWithUnionProperty] | ||
if _not_required_nullable_model is None: | ||
not_required_nullable_model = None | ||
elif isinstance(_not_required_nullable_model, Unset): |
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.
This is the case that was not correctly handled before
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.
Looks good, thanks! Unfortunately that's as good as we've got for testing templates right now. At some point we probably want to also have unit-like tests which validate the generated code itself (e.g. actually running the code with different values to make sure we get out what was intended). It's somewhere on my list of improvements to make when we make the templates more stable.
… returned from the API [openapi-generators#420 & openapi-generators#381]. Thanks @forest-benchling! * Handle optional nullable deserialization * Fix test
Closes #381.