Skip to content

[http-specs] Use a unique SSE protocol model name - #11920

Merged
Timothee Guerin (timotheeguerin) merged 1 commit into
microsoft:mainfrom
JoshLove-msft:joshlove-msft-sse-unique-model-names
Sep 10, 2026
Merged

[http-specs] Use a unique SSE protocol model name#11920
Timothee Guerin (timotheeguerin) merged 1 commit into
microsoft:mainfrom
JoshLove-msft:joshlove-msft-sse-unique-model-names

Conversation

@JoshLove-msft

Copy link
Copy Markdown
Contributor

Summary

Rename Streaming.Sse.Protocol.Info to Streaming.Sse.Protocol.ProtocolInfo in the shared SSE specification so it no longer collides with Streaming.Sse.Unnamed.Info in generated model files and model factory methods.

This is a language-neutral fix in the shared specification, not an emitter-specific workaround. Unnamed.Info retains its desc property, and ProtocolInfo retains its message property. Routes, event names, payloads, and mock behavior are unchanged.

The change contains only the model declaration and its ProtocolEvents.message type reference, plus a fix changelog entry for @typespec/http-specs. It does not include emitter code, dependency upgrades, or scenario-test changes and is independent of those PRs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pkg-pr-new

pkg-pr-new Bot commented Sep 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-specs@11920

commit: 62cf08f

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is a localized, consistent rename with all in-file references updated and a valid .chronus fix entry for the affected package.

Pull request overview

This PR updates the shared SSE streaming specification in @typespec/http-specs to avoid generated-model name collisions by renaming the protocol payload model from Streaming.Sse.Protocol.Info to Streaming.Sse.Protocol.ProtocolInfo.

Changes:

  • Renamed the SSE protocol model InfoProtocolInfo under Streaming.Sse.Protocol.
  • Updated ProtocolEvents.message to reference ProtocolInfo.
  • Added a .chronus fix changeset for @typespec/http-specs describing the collision-avoidance change.
File summaries
File Description
packages/http-specs/specs/streaming/sse/main.tsp Renames the protocol model and updates the event payload type reference to prevent name collisions.
.chronus/changes/sse-unique-protocol-model-name.md Adds a fix changelog entry for @typespec/http-specs documenting the user-visible impact.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @typespec/http-specs
Show changes

@typespec/http-specs - fix ✏️

Use a unique ProtocolInfo model name in the SSE protocol scenarios to avoid model-name collisions in generated clients.

@azure-sdk-automation

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

Merged via the queue into microsoft:main with commit bac3ec9 Sep 10, 2026
34 checks passed
JoshLove-msft added a commit to JoshLove-msft/typespec that referenced this pull request Sep 10, 2026
## Summary

Upgrade the complete TypeSpec dependency set for the C# emitter to the
stable September releases, including matching peer declarations and the
npm lockfile.

| Dependencies | Versions |
| --- | --- |
| Compiler, HTTP, OpenAPI, JSON Schema | `1.16.0` |
| Events, REST, SSE, Streams, Versioning, XML, library linter | `0.86.0`
|
| Azure core and client-generator core (TCGC) | `0.72.0` |
| HTTP specs / Azure HTTP specs | `0.1.0-alpha.43` / `0.1.0-alpha.45` |
| Spec API / Spector / TSP documentation tools | `0.1.0-alpha.17` /
`0.1.0-alpha.29` / `0.77.1` |

All 18 TypeSpec/Azure development dependencies are upgraded together.
Installation resolves without peer-dependency overrides. Newly published
packages are resolved through the public Azure SDK npm feed.

## Regenerated fixtures

Use the latest stable `@typespec/http-specs` release, `0.1.0-alpha.43`,
which includes the shared SSE `ProtocolInfo` model rename from microsoft#11920.
The generated clients no longer need a C# name-collision customization.
Remove the temporary customization and the generator, stub-library, and
regression-test changes introduced solely to support it.

Regenerate the complete fixture set, including SSE protocol stubs and
the new response/body-or-no-content fixture and launch profile. Wire
contracts remain unchanged.

No C# or TypeSpec collision customization, shared TypeSpec import-helper
changes, generator behavior changes, or streaming scenario test changes
are included. New streaming scenario coverage remains in the separate
PR.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
pull Bot pushed a commit to jrcribb/cadl that referenced this pull request Sep 11, 2026
)

## Summary

Add the seven missing SSE protocol Spector tests: `WithEnvelope`,
`WithoutEnvelope`, `Id`, `InvalidId`, `Retry`, `InvalidRetry`, and
`Reconnect`. Assert exact event counts, types, and payloads, preserve
valid metadata, and ignore invalid ID/retry metadata. Reconnect is
explicit using `RequestOptions`: send `Last-Event-ID` from the first
event, then assert resumed event 2.

The diff against `main` is only `SseTests.cs` (+109 lines). Existing
JSONL and basic SSE tests are unchanged. This PR adds no generator,
dependency, or TypeSpec customization changes.

microsoft#11918 has merged, and this branch is synchronized with Microsoft `main`
at `9b8c51de8c15b6dc748ea9cf576d87f91ef058c4`. It uses the pinned
`@typespec/http-specs` `0.1.0-alpha.43` and native unique SSE model
names from microsoft#11920, without the temporary naming workaround.

## Validation

- Regenerated only JSONL and SSE runtime implementations against
alpha.43, then ran all 12 Streaming tests together: 12 passed, 0 failed,
0 skipped.
- All 12 Streaming Spector coverage entries pass. Retained the TRX and
coverage evidence.
- Regenerated both libraries back to stubs. Generated files and
dependency manifests match `main`, and no temporary C# customization or
generated stub `CodeGenTypeAttribute` remains.
- The main synchronization preserved the entire previously validated C#
emitter tree and pinned manifests unchanged. The post-sync stubbed
test-project build passed with 0 warnings and 0 errors; targeted
scenario whitespace formatting, manifest formatting, and emitter lint
passed. Cop checks passed on the identical C# source tree.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib:http-specs For issues/prs related to the @typespec/http-specs package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants