-
Notifications
You must be signed in to change notification settings - Fork 87
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
feat(gen): no NPE on default stream responses #875
Conversation
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.
Push chore: commit generated files
commit to this PR branch, please.
The change itself looks good to me. Thank you for contribution.
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #875 +/- ##
=======================================
Coverage 75.75% 75.75%
=======================================
Files 189 189
Lines 13854 13854
=======================================
Hits 10495 10495
Misses 2837 2837
Partials 522 522 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Hi! Please
|
Head branch was pushed to by a user without write access
10af458
to
a5bc6e0
Compare
I think you need to rebase instead of merge, so merge commit won’t be in your branch 🙃 |
7fc8f17
to
27589c6
Compare
Derp. That's what I get for using GitHub's options... |
20ec958
to
56268c1
Compare
The current implementation of the templated stream response `Read(byte[])` function uses the `Data io.Reader` field without first checking for `nil`. Users who want to return a value with an empty body are forced to explicitly specify an empty `io.Reader` rather than simply ignore the field and get use from the empty struct. This commit adds a `nil` check before using the `Data` field and, if it is `nil`, responds as if it were an empty `io.Reader` instead of panicking. This will hopefully make this library slightly more ergonomic to use.
56268c1
to
301b6db
Compare
The current implementation of the templated stream response
Read(byte[])
function uses theData io.Reader
field without first checking fornil
.Users who want to return a value with an empty body are forced to explicitly specify an empty
io.Reader
rather than simply ignore the field and get use from the empty struct.This commit adds a
nil
check before using theData
field and, if it isnil
, responds as if it were an emptyio.Reader
instead of panicking.This will hopefully make this library slightly more ergonomic to use.