Skip to content

[Bug]: SSEStream response examples are not emitted on OpenAPI 3.2.0 #11090

Description

@rahulpsd18

Describe the bug

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.

Versions:

  • @typespec/compiler: 1.13.0
  • @typespec/http: 1.13.0
  • @typespec/openapi3: 1.13.0
  • @typespec/sse: 0.83.0
  • @typespec/events: 0.83.0
  • @typespec/streams: 0.83.0

Reproduction

https://typespec.io/playground/?tspconfig=ZW1pdDoKICAtICJAdHlwZXNwZWMvb3BlbmFwaTMiCm9wdGlvbnPEItQgxBggIMcPLXZlcnPILsQBLSAiMy4yLjAi&c=aW1wb3J0ICJAdHlwZXNwZWMvaHR0cCI7CtIZc3Nl1RhldmVudHMiOwoKdXNpbmcgSHR0cDvHDFR5cGVTcGVjLlNTRdEURcU5OwoKQHNlcnZpY2UoI3sgdGl0bGU6ICJTU0UgZXhhbXBsZSBkcm9wcGVkIiB9KQpuYW1lc3BhY2UgUmVwcm87Cgptb2RlbCBNZXNzYWdlIHsKICDkAJs6ICJtxhMiO8QTZXh0OiBzdHJpbmc7Cn0KCkDmALcKdW5pb24g5gCLxT3HSSzFJXJvdXRlKCIvc3RyZWFtIikKQGdldApvcMRKZWFtKCk6IFNTRVPFDTzGRT7kANFAb3BF5gC9KMYqLAogICPEXyAgcmV0dXJu5AEGOsgTICBjb250ZW50xhYi5ACu5gFYLcd6xEDEAWJvZHk6ICJkYXRhOiB7XCLkAOtcIjpc6ADtXCIsXMU%2FxRVoZWxsb1wifVxuXG7HQ33EB8UF6wFt5wCs5wDWIiB9Cik7&vs=%7B%7D

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions