Skip to content

Fix Python wire encoding type regression - #11637

Merged
Yuchao Yan (msyyc) merged 4 commits into
mainfrom
l0lawrence-fix-python-wire-encoding
Aug 13, 2026
Merged

Fix Python wire encoding type regression#11637
Yuchao Yan (msyyc) merged 4 commits into
mainfrom
l0lawrence-fix-python-wire-encoding

Conversation

@l0lawrence

Copy link
Copy Markdown
Member

TCGC now supplies wireType for boolean, integer, and bytes encodings. The Python emitter treated every encoded type with a wire type as unsupported, replacing the client-facing type and regressing existing boolean, numeric, and byte serialization behavior.

This change preserves the normal Python type for supported string, base64, and base64url encodings while retaining the wire-type fallback for custom or unsupported encodings. It also documents that fallback behavior and adds focused emitter coverage for the supported combinations and custom-encoding path.

This PR supersedes #11619 (which was opened from a fork and therefore skipped the emitter-diff check).

Validation

  • npm run build
  • npm run format
  • npm run lint -- --emitter
  • npm run test:emitter (13 tests)
  • npm run regenerate (Azure and unbranded)
  • Targeted boolean, numeric, and bytes mock tests (26 tests per flavor)

Preserve supported client-facing types when TCGC supplies wire types for boolean, integer, and byte encodings.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f0bffcdc-e290-4621-980a-834a1e67bdc2
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f0bffcdc-e290-4621-980a-834a1e67bdc2
@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 Aug 12, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-python@11637

commit: 578fc24

@github-actions

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

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

Preserve Python boolean, integer, and bytes client types when using supported string, base64, or base64url wire encodings.

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Python emitter diff

Baseline gh:d457ff7fae3032837fa62b4309cdb4c4ba531e57 vs this PR.

No changes to generated output.

Rendered diff: inline on the run summary, or the emitter-diff-html artifact.

Informational check (eng/emitter-diff); does not block the PR.

@azure-sdk-automation

azure-sdk-automation Bot commented Aug 12, 2026

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

Comment thread packages/http-client-python/emitter/src/types.ts Outdated
Comment thread packages/http-client-python/emitter/src/types.ts Outdated
@msyyc
Yuchao Yan (msyyc) added this pull request to the merge queue Aug 13, 2026
Merged via the queue into main with commit 152db11 Aug 13, 2026
42 checks passed
@msyyc
Yuchao Yan (msyyc) deleted the l0lawrence-fix-python-wire-encoding branch August 13, 2026 02:55
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.

3 participants