Open carusyte opened 11 months ago
Can you share an example of what the OpenAPI schema looks like for a SSE route?
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:
I'd love to document the response format more formally if possible.
This is needed to support Server Sent Events or Streaming not only in validation step but for the generated SwaggerUI API docs as well.