You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: SSEStream response examples are not emitted on OpenAPI 3.2.0 #11090
I have an operation that returns SSEStream<T> and I attached a response example with @@opExample.
When I emit with @typespec/openapi3 targeting OpenAPI 3.2.0, the example is missing from the output: the text/event-stream response has itemSchema but no examples.
There's no error or warning, so the example just silently disappears.
The example itself is valid. If I switch the emitter to OpenAPI 3.0.0, the same example shows up fine (under examples, next to schema: { type: string }, with the expected streams-not-supported warning). So it only gets dropped on the 3.2.0 stream output.
When using @@opExample`` on an operation returning SSEStream<T>, the example is silently dropped in the OpenAPI 3.2.0 output of the `openapi3` emitter, while it emits correctly under OpenAPI 3.0.0.
Affected component: typespec/openapi3 emitter — specifically the SSE/streaming response rendering path for OpenAPI 3.2.0.
Behavior difference: In OpenAPI 3.0.0 mode the emitter falls back to a flat schema: { type: string } for event stream content, where examples are attached. In 3.2.0 mode it outputs an itemSchema structure for native stream support, but the example-emission code path likely doesn't handle this case and silently discards the example.
Root cause hypothesis: The code that emits examples for text/event-stream responses was not updated to handle the OpenAPI 3.2.0-specific streaming schema representation (itemSchema), so examples are lost silently.
No duplicate issues found.
📝 Suggested next steps
Locate the openapi3 emitter code handling text/event-stream media types for 3.2.0 and compare it with the 3.0.0 path to find where examples are dropped.
Extend example-emission logic so @@opExample`` values are included alongside the itemSchema in 3.2.0 output.
Add a test covering @@opExample`` on SSEStream operations for both 3.0.0 and 3.2.0 targets.
Activity
github-actions commentedon Jun 26, 2026
🎯 Issue Triage
When using
@@opExample`` on an operation returningSSEStream<T>, the example is silently dropped in the OpenAPI 3.2.0 output of the `openapi3` emitter, while it emits correctly under OpenAPI 3.0.0.Category: Bug
Area:
emitter:openapi3🔗 [Playground Reproduction]((typespec.io/redacted)
🔍 Analysis
typespec/openapi3emitter — specifically the SSE/streaming response rendering path for OpenAPI 3.2.0.schema: { type: string }for event stream content, where examples are attached. In 3.2.0 mode it outputs anitemSchemastructure for native stream support, but the example-emission code path likely doesn't handle this case and silently discards the example.examplesfortext/event-streamresponses was not updated to handle the OpenAPI 3.2.0-specific streaming schema representation (itemSchema), so examples are lost silently.📝 Suggested next steps
openapi3emitter code handlingtext/event-streammedia types for 3.2.0 and compare it with the 3.0.0 path to find where examples are dropped.@@opExample`` values are included alongside theitemSchemain 3.2.0 output.@@opExample`` onSSEStreamoperations for both 3.0.0 and 3.2.0 targets.