-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
make generated swagger json match gateway behavior for server streams #850
make generated swagger json match gateway behavior for server streams #850
Conversation
…esult" object to match gateway behavior
Codecov Report
@@ Coverage Diff @@
## master #850 +/- ##
==========================================
+ Coverage 51.75% 53.08% +1.32%
==========================================
Files 39 39
Lines 3824 3845 +21
==========================================
+ Hits 1979 2041 +62
+ Misses 1655 1610 -45
- Partials 190 194 +4
Continue to review full report at Codecov.
|
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.
Thanks for this valuable contribution! I'm wondering if we could consider adding some automated tests to this as well? I see the regeneration of the files have output some differences which is a good indication that it's working but some automated tests should allow us to prevent regressions as well. What do you think?
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
CLAs look good, thanks! |
@mechinn Are you planning on fixing this soon? I'm looking to make a release soon and just wondering if I should wait for this to be ready. |
yeah sorry getting back to work on the error part after the long weekend |
…adding error to stream wrapper
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 to me, just a few questions before we merge.
if meth.GetServerStreaming() { | ||
runtimeStreamError := fullyQualifiedNameToSwaggerName(".grpc.gateway.runtime.StreamError", reg) | ||
glog.V(1).Infof("StreamError FQMN: %s", runtimeStreamError) | ||
streamError, err := reg.LookupMsg(".grpc.gateway.runtime", "StreamError") |
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.
Ditto
Really excited to land this, thanks for the contribution @mechinn! |
…grpc-ecosystem#850) * grpc-ecosystem#579 fixing protoc-gen-swagger to wrap server stream messages with "result" object to match gateway behavior * grpc-ecosystem#579 fixing test example swagger json * change streamdefinitions to x-stream-definitions and add test * move runtime internal to root of repo for use in protoc-gen-swagger, adding error to stream wrapper * adding comment explaining AddStreamError * fix bazel
Fixes #579, until v2 removes "result" wrapping of server stream response messages this will make protoc-gen-swagger wrap server stream messages in a result object which matches the gateway's behavior for consistency.