-
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unmarshal response from streaming #2189
Comments
An alternative way to unmarshal it is to wrap your response message type in the envelope type manually:
|
Yes I ended up doing something like this in our tests.
I am not sure if using the proto type in the envelope would work as expected bc JSONPb should be used for unmarshalling. |
You can use jsonpb with a custom type too. Another alternative is to generate the openapiv2 spec and then generate a client using that, it should be able to parse the streaming messages too. |
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. |
Is there any documentation on how error reporting per entry works, can server control how and what error goes to client. |
gRPC generally supports returning an error at any point in the streaming, so the grpc-gateway must also be able to return an error at any point in the streaming. |
馃殌 Feature
The streaming response is wrapped into
result
object (see #1254, applies for v1 and v2). This makes it impossible to unmarshal (via JSONPb) the response body into protoc generated objects (MyResponse
) in this case. The response can be unmarshalled only if the "result" envelope is removed (e.g. string manipulation).The response body looks like:
Is there a way we could improve this? I have tried to define a proto message (see below) that could be used to remove the envelope.
The text was updated successfully, but these errors were encountered: