-
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
Error when using oneof name in response body selector #1264
Comments
Thanks for raising the issue. The |
Well, having never dealt with either underlying proto handling code or grpc-gateway code, any pointers you may have would be useful :-) |
Closing -- it may be a bug but we're actually going to structure our API differently (for different reasons than this). If you want to keep it open to track, feel free! |
Okay! Feel free to reopen again if you need it later. If you need any other support for the gateway, I'm usually available in #grpc-gateway on Gophers slack. |
This seems like a useful feature. I investigated a bit and it looks like we'd want to modify the request handler template
To test the oneof and return the value that is actually set. When I hacked my generated code the following seemed to do the correct thing.
where my proto looked like
No immediate plans to submit a fix for this. We are currently evaluating the use of gRPC and gRPC-gateway. If we end up adopting it we may try to tackle this. |
Thanks for your input, I'll reopen this bug report then :). |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
As asked from my question in #585 I'm filing a new bug here.
I'm trying to have the response_body in the HTTP options use the oneof field, so that we can have alternate schemas in the response. However, this causes an error. Here is a minimal proto:
Here is
tree
output:And here is my invocation:
protoc -I. -I service/third_party --go_out=plugins=grpc,paths=source_relative:./gen --grpc-gateway_out=logtostderr=true,paths=source_relative:./gen service/service.proto
When I run the command I get:
--grpc-gateway_out: no field "item" found in GetHostResponse
Note that if I change the response body def to select either "a" or "b" -- not actually what I want, but just to try it out -- I get a different error (which I think is already captured in a different ticket):
--grpc-gateway_out: 224:9: expected operand, found 'if'
The text was updated successfully, but these errors were encountered: