Skip to content

[http-client-js] Preserve parsed body in storage compat responses - #5325

Open
Jeremy Meng (jeremymeng) wants to merge 1 commit into
Azure:mainfrom
jeremymeng:jeremymeng-fix-storage-compat-headers
Open

[http-client-js] Preserve parsed body in storage compat responses#5325
Jeremy Meng (jeremymeng) wants to merge 1 commit into
Azure:mainfrom
jeremymeng:jeremymeng-fix-storage-compat-headers

Conversation

@jeremymeng

Copy link
Copy Markdown
Member

Copilot agent :copilot: (on behalf of Jeremy Meng (@jeremymeng)):

Summary

  • Copy the parsed response body before flattening storage compatibility response headers.
  • Preserve header precedence on the top-level operation result without mutating _response.parsedBody.
  • Add regression coverage for body/header name collisions and circular response metadata.

Testing

  • pnpm --filter @azure-tools/typespec-ts exec vitest run --project test-next test-next/unit/static-helpers/storage-compat-response.test.ts
  • pnpm -r --filter "@azure-tools/typespec-ts..." build
  • pnpm change verify

Fixes #5323

Copy the parsed response body before flattening headers so storage compatibility metadata retains the original body shape.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @azure-tools/typespec-ts
Show changes

@azure-tools/typespec-ts - fix ✏️

Preserve the original parsed response body when flattening response headers for storage compatibility.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Package size report

✅ No notable package size changes compared to the base branch.

13 package(s) with no notable change
Package Packed (base → head) Δ Packed Unpacked (base → head) Δ Unpacked
@azure-tools/typespec-ts 527.17 KB → 527.19 KB +21 B (+0.0%) 2.54 MB → 2.54 MB +49 B (+0.0%)
@azure-tools/typespec-java 13.51 MB → 13.51 MB -13 B (-0.0%) 15.03 MB → 15.03 MB
@azure-tools/azure-http-specs 146.71 KB → 146.71 KB 1.16 MB → 1.16 MB
@azure-tools/typespec-autorest 80.93 KB → 80.93 KB 395.06 KB → 395.06 KB
@azure-tools/typespec-autorest-canonical 7.42 KB → 7.42 KB 26.00 KB → 26.00 KB
@azure-tools/typespec-azure-core 129.43 KB → 129.43 KB 702.77 KB → 702.77 KB
@azure-tools/typespec-azure-portal-core 42.41 KB → 42.41 KB 192.91 KB → 192.91 KB
@azure-tools/typespec-azure-resource-manager 171.92 KB → 171.92 KB 1.04 MB → 1.04 MB
@azure-tools/typespec-azure-rulesets 5.16 KB → 5.16 KB 32.09 KB → 32.09 KB
@azure-tools/typespec-client-generator-core 229.25 KB → 229.25 KB 1.23 MB → 1.23 MB
@azure-tools/typespec-go 259.87 KB → 259.87 KB 1.33 MB → 1.33 MB
@azure-tools/typespec-metadata 15.91 KB → 15.91 KB 62.26 KB → 62.26 KB
@azure-tools/typespec-python 42.22 KB → 42.22 KB 164.91 KB → 164.91 KB

Packed = gzipped .tgz published to npm. Unpacked = total extracted size. 🆕 added, 🗑️ removed. Packages from the core/ submodule are not included.
🔴 grew · 🟢 shrank — only changes of at least 512 B and 0.5% are marked.

@pkg-pr-new

pkg-pr-new Bot commented Aug 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@azure-tools/typespec-ts@5325

commit: 15e7081

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

You can try these changes here

🛝 Playground 🌐 Website

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:typescript Issues for @azure-tools/typespec-ts emitter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[http-client-js] enable-storage-compat mutates parsedBody while flattening response headers

2 participants