-
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
Streamed response is not valid json (or: is this the expected format?) #581
Comments
Streaming requests and responses are mapped to JSON streaming by design. |
@yugui Thank you for the clarification. |
@yugui shouldn't the content type of the response be |
@veqryn interesting, do you have a source for this? I couldn't find it in the Wikipedia article. |
Is there an RFC? Is it well supported in browsers and clients? It seems a little bit bare bones, if you don't mind me saying. Do we risk breaking more consumers than not by introducing it? |
I am not sure honestly. I don't think there is an RFC yet... |
I think we might be best of waiting here, it doesn't seem clear to me that this is indeed appropriate. I'd be happy to be proved wrong, of course. |
K. They should probably get an RFC in order. |
We're running into some issues with this because we have js clients that see |
I think it should be possible to customize this with a custom marshaler, such that we don't need to make a change for all users. |
I've written a simple a simple proto that includes this rpc with a stream response:
My server replies with 3 SomeData records. The result from curl via my generated grpc-gateway is:
This appears to be newline-delimited json, which is fine, but it's not valid json.
AFAIK I'm using the latest grpc-gateway code, which I installed per the instructions:
With go 1.10
Is this the expected stream response format? I'd suggest enclosing the results in a list, which would add only 1 byte per line (the comma), and would then be valid json:
(Sorry if this is a repeat of #481, but it wasn't clear how that issue was resolved.)
The text was updated successfully, but these errors were encountered: