-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Configure response content type at the method level #1130
Configure response content type at the method level #1130
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
This PR will add the possibility to configure the response content type at the method level. To do such the developer will have to set the `produces` property like in the following example. ``` rpc OverwriteResponseContentType(google.protobuf.Empty) returns (google.protobuf.StringValue) { option (google.api.http) = { get: "/v2/example/overwriteresponsecontenttype" }; option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = { produces: "application/text" }; } ```
0b4951b
to
6f32c42
Compare
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
I'm not sure why the build is failing on Circle CI. It's passing locally. If someone can help... |
The bazel failure should be fixed by running: $ docker run -itv $(pwd):/grpc-gateway -w /grpc-gateway --entrypoint /bin/bash --rm \
l.gcr.io/google/bazel -c 'bazel run :gazelle' From https://github.com/grpc-ecosystem/grpc-gateway/blob/master/CONTRIBUTING.md |
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.
LGTM, lets just get the bazel error fixed (I think it's the new wrappers import in a_bit_of_everything.proto
that's causing it).
Codecov Report
@@ Coverage Diff @@
## master #1130 +/- ##
=========================================
- Coverage 53.87% 53.8% -0.07%
=========================================
Files 42 42
Lines 4197 4202 +5
=========================================
Hits 2261 2261
- Misses 1689 1693 +4
- Partials 247 248 +1
Continue to review full report at Codecov.
|
Thanks for your contribution! |
All green. You were right the import was missing in the build definition. Your command did the trick. Maybe adding it to the |
) * Configure response content type at the method level This PR will add the possibility to configure the response content type at the method level. To do such the developer will have to set the `produces` property like in the following example. ``` rpc OverwriteResponseContentType(google.protobuf.Empty) returns (google.protobuf.StringValue) { option (google.api.http) = { get: "/v2/example/overwriteresponsecontenttype" }; option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = { produces: "application/text" }; } ``` * Fix build
) * Configure response content type at the method level This PR will add the possibility to configure the response content type at the method level. To do such the developer will have to set the `produces` property like in the following example. ``` rpc OverwriteResponseContentType(google.protobuf.Empty) returns (google.protobuf.StringValue) { option (google.api.http) = { get: "/v2/example/overwriteresponsecontenttype" }; option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = { produces: "application/text" }; } ``` * Fix build
This PR will add the possibility to configure the response content
type at the method level.
To do such the developer will have to set the
produces
propertylike in the following example.