Skip to content

Conversation

@msyyc
Copy link
Contributor

@msyyc msyyc commented Feb 9, 2026

Description

This PR improves the handling of encode types in the Python emitter by falling back to the wire type when an unknown or unsupported encode is encountered, instead of silently ignoring it.

Changes

  • Restructured the encode handling logic in emitBuiltInType for clarity
  • Added explicit handling for duration with ISO8601 encode
  • Added explicit handling for utcDateTime/offsetDateTime with unixTimestamp encode
  • Added a fallback path that uses the wire type when the encode is not recognized, ensuring the emitted type is still correct

@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 Feb 9, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

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

Fall back to wire type for unknown or unsupported encode

@azure-sdk
Copy link
Collaborator

azure-sdk commented Feb 9, 2026

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 10, 2026

Open in StackBlitz

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

commit: adbd97a

@msyyc msyyc marked this pull request as ready for review February 10, 2026 03:57
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.

2 participants