Skip to content
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

Should streaming endpoints produce text/event-stream content? #26

Open
tmc opened this issue Jun 26, 2015 · 8 comments
Open

Should streaming endpoints produce text/event-stream content? #26

tmc opened this issue Jun 26, 2015 · 8 comments

Comments

@tmc
Copy link
Collaborator

tmc commented Jun 26, 2015

https://html.spec.whatwg.org/multipage/comms.html#server-sent-events

This would allow newer browsers to use the EventSource APIs cleanly.

@yugui
Copy link
Member

yugui commented Jun 30, 2015

Interesting.
But at this moment, compatibility to Swagger is more important for us. Let me check the compatibility before decision.

@mwitkow
Copy link
Member

mwitkow commented Sep 21, 2015

We're also very much interested in this. The biggest benefit of using event-stream is that parsing a stream of JS events in a browser doesn't buffer up the whole content of the stream.

I think implementing this could be relatively easy. Adding special case of Accept: text/event-stream into the generated code that will return a single EventSource event called data with the proto JSON as payload, followed by an empty data to force an event trigger.

We're actually interested in doing this ourselves. @yugui, would you accept PRs for this?

@yugui
Copy link
Member

yugui commented Sep 24, 2015

We're actually interested in doing this ourselves. @yugui, would you accept PRs for this?

Yes, I will.

@tmc
Copy link
Collaborator Author

tmc commented Mar 18, 2016

@mwitkow any action on this?

@tmc
Copy link
Collaborator Author

tmc commented Mar 18, 2016

@yugui for swagger-compat questions: OAI/OpenAPI-Specification#396

@yugui
Copy link
Member

yugui commented Mar 28, 2016

I have read the spec of the server-sent events.
IIUC, the spec defines something different from the current line-based streaming. So I decided not to simply replace the current way of streaming with server-sent events.

But it might be useful if we can support server-sent events as a part of pluggable marshaling mechanism.

@hajsf
Copy link

hajsf commented Jul 13, 2022

But it might be useful if we can support server-sent events

Any update on this?

@johanbrandhorst
Copy link
Collaborator

No update yet, haha. This issue is 7 years old 😓. Lets try to see what we can do in the other issue first?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants