WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@msyyc
Copy link
Contributor

@msyyc msyyc commented Nov 17, 2025

Context is available here

  • Since the complete design for discriminated unions is not yet finalized, this pull request aims solely to ensure that the generated code functions correctly and does not produce any linting errors.

  • Following this pull request, the Python emitter will be able to generate the SDK without exceptions, thereby facilitating SDK generation. SDK users will then have the option to add customizations to support discriminated unions if necessary.

Summary:

  • This pull request primarily addresses import errors related to discriminated unions by treating them as common unions in a straightforward manner.

@microsoft-github-policy-service microsoft-github-policy-service bot added the emitter:client:python Issue for the Python client emitter: @typespec/http-client-python label Nov 17, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 17, 2025

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

@typespec/http-client-python - fix ✏️

Fix import when body parameter is union of models

@azure-sdk
Copy link
Collaborator

azure-sdk commented Nov 17, 2025

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 18, 2025

Open in StackBlitz

npm i https://pkg.pr.new/microsoft/typespec/@typespec/http@9014
npm i https://pkg.pr.new/microsoft/typespec/@typespec/http-client@9014

commit: 43fc049

@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 Dec 19, 2025
@microsoft-github-policy-service
Copy link
Contributor

Hi @@msyyc. Your PR has had no update for 30 days and it is marked as a stale PR. If it is not updated within 30 days, the PR will automatically be closed. If you want to refresh the PR, please remove the stale label.

@msyyc msyyc removed the stale Mark a PR that hasn't been recently updated and will be closed. label Dec 22, 2025
@msyyc msyyc marked this pull request as ready for review December 25, 2025 03:23
@msyyc msyyc changed the title [python] enable test case of discriminated union [python] Fix import when body parameter is union of models Dec 25, 2025
@msyyc msyyc added this pull request to the merge queue Dec 25, 2025
Merged via the queue into main with commit 51348fd Dec 25, 2025
38 checks passed
@msyyc msyyc deleted the python-discriminated-union branch December 25, 2025 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:python Issue for the Python client emitter: @typespec/http-client-python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants