Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .chronus/changes/fix-python-raw-bytes-encoding-2026-10-21.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: fix
packages:
- "@typespec/http-client-python"
---

Preserve the ytes type for raw bytes encoded as ytes with a wire type, preventing regression to string and preserving binary streaming.
2 changes: 1 addition & 1 deletion packages/http-client-python/emitter/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ const sdkScalarKindToPythonKind: Record<string, string> = {
const supportedPythonEncodings = new Map<string, ReadonlySet<string>>([
["boolean", new Set(["string"])],
["integer", new Set(["string"])],
["bytes", new Set(["base64", "base64url"])],
["bytes", new Set(["base64", "base64url", "bytes"])],
]);

function emitBuiltInType(
Expand Down
2 changes: 1 addition & 1 deletion packages/http-client-python/emitter/test/types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe("typespec-python: built-in types", () => {
},
);

it.each(["base64", "base64url"] as const)("preserves bytes encoded as %s", (encode) => {
it.each(["base64", "base64url", "bytes"] as const)("preserves bytes encoded as %s", (encode) => {
deepStrictEqual(
emitBuiltInType(createBuiltInType("bytes", encode, createBuiltInType("string"))),
{
Expand Down