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

How can we add "text/event-stream" to the "Accept/Content-Type" headers? #64

Open
carusyte opened this issue Oct 13, 2023 · 2 comments
Open

Comments

@carusyte
Copy link

This is needed to support Server Sent Events or Streaming not only in validation step but for the generated SwaggerUI API docs as well.

@pgjones
Copy link
Owner

pgjones commented Jan 30, 2024

Can you share an example of what the OpenAPI schema looks like for a SSE route?

@pamelafox
Copy link

When I last looked into this, it was an open discussion as to how OpenAPI should document SSE routes and streaming routes generally.

I am personally trying to add validation (or at least documentation) for a route that responds with a stream with a mime-type of "application/json-lines", a "transfer-encoding": "chunked" header, and newline-delimited JSON. I attempted to use validate_response, but wasn't sure what to put in there as the data type.

Here's how the streaming response gets rendered, with no validation:

Screenshot 2024-02-13 at 4 36 14 PM

I'd love to document the response format more formally if possible.

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

No branches or pull requests

3 participants