Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 29, 2025

Streaming endpoints were returning empty text/event-stream content without proper schemas. This adds typed SSE event schemas following the Speakeasy SSE pattern.

Changes

  • New StreamingSchemaGenerator - Creates event type schemas with discriminated unions:

    • 10 event types: update, delete, notification, filters_changed, conversation, announcement, announcement.reaction, announcement.delete, status.update, notifications_merged
    • Endpoint-specific schemas (e.g., StreamingUserEvent, StreamingDirectEvent) with only relevant event types
    • Payload types reference existing entities (Status, Notification, etc.) with oneOf for string/object flexibility
  • Updated MethodConverter - Streaming endpoints now reference appropriate event schemas instead of empty content

Example

Before:

"text/event-stream": {}

After:

"text/event-stream": {
  "schema": { "$ref": "#/components/schemas/StreamingUserEvent" }
}

Where StreamingUserEvent is:

{
  "oneOf": [
    { "$ref": "#/components/schemas/UpdateEvent" },
    { "$ref": "#/components/schemas/DeleteEvent" },
    { "$ref": "#/components/schemas/NotificationEvent" },
    ...
  ]
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • otel.cloud.redocly.com
    • Triggering command: /opt/hostedtoolcache/node/24.11.1/x64/bin/node node /home/REDACTED/work/mastodon-openapi/mastodon-openapi/node_modules/.bin/redocly lint --format=github-actions dist/schema.json (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Stream response schemas</issue_title>
<issue_description>Add schema for the data shapes in the streaming endpoints.

The content type should be updated to text/event-stream. Implement schemas similar to "Handling Multiple Event Types" from the example link.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add schema for streaming response data shapes Add SSE response schemas for streaming endpoints Nov 29, 2025
Copilot AI requested a review from abraham November 29, 2025 02:23
Copilot finished work on behalf of abraham November 29, 2025 02:23
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

Successfully merging this pull request may close these issues.

Stream response schemas

2 participants