-
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
grpc-gateway don't work well when using github.com/golang/protobuf/ptypes/struct with streaming #999
Comments
Thanks for the bug report! This looks pretty bad, but it also sounds like you have a good test to reproduce the panic, with it's a great way to start creating a fix! Would you be interested in contributing a fix for this? |
I don't have enough context about how grpc-gateway works. Could you locate some files that might relate to this bug? I would love to help if it is a trivial bug. |
Wait, I've just realised you're using gogo/protobuf (as is evident by that backtrace). This could be another one of those subtle gogo/protobuf bugs. Can you try using golang/protobuf? |
Thanks for pointing it out. It seems like a bug in gogo/protobuf. Everything works as expected after using golang/protobuf instead! |
Glad that fixed it, but it's not so much a bug in gogo/protobuf as a simple incompatibility with our codebase... It's an unfortunate consequence of the way go protobuf was designed from the start. Anyway, glad it works now! |
Steps you follow to reproduce the error:
My code has the following API definition
With the code logic following the example in the integration test. https://github.com/grpc-ecosystem/grpc-gateway/blob/master/examples/integration/integration_test.go#956
When running the tests against the http endpoint I got the following error, yet the same test works for the grpc endpoint.
What did you expect to happen instead:
Test passed
What's your theory on why it isn't working:
I think the grpc-gateway plugin might be incompatible with messages having the
google.protobuf.Struct
field. I have another service with a stream response and it produced the same error when calling the API service via its HTTP endpoint. I was able to have a workaround by replacing https://github.com/grpc-ecosystem/grpc-gateway/blob/master/examples/integration/integration_test.go#1021 withyet using the same trick in a bidirectional streaming service gives a partial response without the
google.protobuf.Struct
field.The text was updated successfully, but these errors were encountered: