Skip to content

Examples multi response#10180

Merged
timotheeguerin merged 9 commits into
microsoft:mainfrom
timotheeguerin:examples-multi-response
May 4, 2026
Merged

Examples multi response#10180
timotheeguerin merged 9 commits into
microsoft:mainfrom
timotheeguerin:examples-multi-response

Conversation

@timotheeguerin
Copy link
Copy Markdown
Member

No description provided.

@microsoft-github-policy-service microsoft-github-policy-service Bot added lib:http emitter:openapi3 Issues for @typespec/openapi3 emitter labels Mar 27, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 27, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http@10180
npm i https://pkg.pr.new/@typespec/openapi3@10180

commit: 038d130

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 27, 2026

All changed packages have been documented.

  • @typespec/http
  • @typespec/openapi3
Show changes

@typespec/http - feature ✏️

[API] Operation returning a union of types without status code or content type will be treated as a single response

@typespec/openapi3 - fix ✏️

Fix examples when operation return type have union of response mapping to same status code

@azure-sdk
Copy link
Copy Markdown
Collaborator

azure-sdk commented Mar 27, 2026

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@microsoft-github-policy-service microsoft-github-policy-service Bot added the stale Mark a PR that hasn't been recently updated and will be closed. label Apr 27, 2026
@timotheeguerin timotheeguerin removed the stale Mark a PR that hasn't been recently updated and will be closed. label Apr 28, 2026
@timotheeguerin timotheeguerin marked this pull request as ready for review April 29, 2026 16:21
@timotheeguerin timotheeguerin added the int:azure-specs Run integration tests against azure-rest-api-specs label Apr 29, 2026
Copy link
Copy Markdown
Contributor

@markcowl markcowl left a comment

Choose a reason for hiding this comment

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

It feels like we should have a discriminated union test, and a test over the union variant flattening logic.

Also wonder about the potential for breaking changes in emitters given the changes in the way responses are processed

@timotheeguerin
Copy link
Copy Markdown
Member Author

@markcowl good point, will add test in http as well.
For the breaking change, it did hit one rule test in azure core because the test was returning : Lro | {erorr: string} combing them both now as 200 response. It used to work because we'd be happy the first 200 returned a LRO but this feels like to me it caught a bug ( error was also encoded as 200 but didn't have lro annotations)

Comment thread packages/http/test/responses.test.ts
@timotheeguerin timotheeguerin added this pull request to the merge queue May 4, 2026
Merged via the queue into microsoft:main with commit ecf574f May 4, 2026
30 of 31 checks passed
@timotheeguerin timotheeguerin deleted the examples-multi-response branch May 4, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:openapi3 Issues for @typespec/openapi3 emitter int:azure-specs Run integration tests against azure-rest-api-specs lib:http

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants