Skip to content

support for server sent events #150

@casualjim

Description

@casualjim

Add support for server sent events

This includes a proposal to swagger-spec repo for an extension.

Server sent events are a specific mime type, currently in swagger 2.0 there is no support for different responses based on request criteria like content type.

In this proposal the idea is that the only possible response from that endpoint is a sse-eventstream

paths:
  /:
    get:
      produces: ["text/event-stream"]
      responses:
        default:
          description: example of defining events for sse 
          schema:
            type: object
            x-events:
              added:
                type: object
                properties:
                  message:
                    type: string
                  createdAt:
                    type: string
                    format: date-time
              updated:
                type: object
                  properties:
                    previous:
                      type: string
                    newValue:
                      type: string
                    updatedAt:
                      type: string
                      format: date-time

related: OAI/OpenAPI-Specification#396

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions