Skip to content

Sync typespec-java core: fix XML serializer for azure-v1 and raw bytes - #5012

Merged
weidongxu-microsoft merged 2 commits into
release/july-2026from
weidongxu-microsoft/sync-java-xml-bytes-fix
Jul 22, 2026
Merged

Sync typespec-java core: fix XML serializer for azure-v1 and raw bytes#5012
weidongxu-microsoft merged 2 commits into
release/july-2026from
weidongxu-microsoft/sync-java-xml-bytes-fix

Conversation

@weidongxu-microsoft

Copy link
Copy Markdown
Member

Part A (fix) of the next typespec-java hotfix.

Advances packages/typespec-java/core-commit.json to microsoft/typespec 43ff0041 (#11329):

  • Gate XML serialization to azure-v1 data-plane clients.
  • Skip the XML ObjectSerializer for raw byte[]/BinaryData payloads that aren't structured XML models, fixing a build break from a reference to the non-generated XmlSerializerProviders helper.

Follow-up fix on top of 0.45.8's XML serialization support. Adds a fix changelog entry. Version bump + publish (Part B) follows in a separate publish/hotfix/* PR after this merges.

Targets release/july-2026 (NOT main).

@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:java Issues for @azure-tools/typespec-java emitter label Jul 22, 2026
@azure-sdk-automation

azure-sdk-automation Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

❌ There is undocummented changes. Run chronus add to add a changeset or click here.

The following packages have changes but are not documented.

  • @azure-tools/typespec-autorest

The following packages have already been documented:

  • @azure-tools/typespec-java
Show changes

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

Fix XML serialization to only apply for azure-v1 data-plane clients, and to skip the XML ObjectSerializer for raw byte[]/BinaryData payloads that are not structured XML models. This avoids emitting a reference to a non-generated XmlSerializerProviders helper (which caused a build break) for operations that return raw XML bytes.

Advance core-commit.json to microsoft/typespec 43ff0041 (#11329): gate the XML serializer to azure-v1 data-plane clients and skip the XML ObjectSerializer for raw byte[]/BinaryData payloads, fixing a build break from a reference to a non-generated XmlSerializerProviders helper.

Also sync emitter-tests via SyncTests.ps1 (adds tsp/xml-bytes-verify.tsp and the XmlBytesVerify hand-written test).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: cd6f2e08-d6d3-42ae-affd-bc71e98086f7
@weidongxu-microsoft
weidongxu-microsoft force-pushed the weidongxu-microsoft/sync-java-xml-bytes-fix branch from d0fbd58 to b82c7a8 Compare July 22, 2026 05:19
@weidongxu-microsoft
weidongxu-microsoft marked this pull request as ready for review July 22, 2026 05:20
@azure-sdk-automation

Copy link
Copy Markdown
Contributor

You can try these changes here

🛝 Playground 🌐 Website

@pkg-pr-new

pkg-pr-new Bot commented Jul 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@azure-tools/typespec-autorest@5012
npm i https://pkg.pr.new/@azure-tools/typespec-java@5012

commit: d4142b5

…suppression)

Adopt main's archive-based Get-CoreSourceRoot/Remove-CoreSourceRoot (no submodule mutation), progress suppression, and Setup.ps1 registry pin. Generate.ps1 intentionally NOT taken from main to preserve the XML-generation fix.

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

Copilot-Session: cd6f2e08-d6d3-42ae-affd-bc71e98086f7
@weidongxu-microsoft
weidongxu-microsoft merged commit 577d253 into release/july-2026 Jul 22, 2026
28 of 29 checks passed
@weidongxu-microsoft
weidongxu-microsoft deleted the weidongxu-microsoft/sync-java-xml-bytes-fix branch July 22, 2026 06:21
weidongxu-microsoft added a commit that referenced this pull request Jul 22, 2026
Hotfix version bump for `@azure-tools/typespec-java` 0.45.8 -> 0.45.9.

Publishes the fix from #5012 (XML serializer gated to azure-v1
data-plane + skip raw byte[]/BinaryData payloads).

- Consumes the `fix` change file (patch bump)
- `packages/typespec-java/package.json`: 0.45.8 -> 0.45.9
- `packages/typespec-java/emitter-tests/package.json`: version + .tgz
dep bumped to 0.45.9
- `core` submodule unchanged

Squash merge to trigger the NPM publish pipeline.
XiaofeiCao added a commit to XiaofeiCao/typespec-azure that referenced this pull request Jul 22, 2026
…Azure#5014)

Backmerge of `release/july-2026` into `main`.

The auto-backmerge workflow failed for Azure#5013 due to the known same-day
branch-name collision (the `backmerge/release/july-2026-2026-07-22`
branch was already created by Azure#5012's run). Fast-forwarded the branch to
the current release head and opening this PR manually.

Brings into `main`:
- typespec-java 0.45.8 (XML serialization support, Azure#4987/Azure#4990)
- typespec-java 0.45.9 (XML serializer gated to azure-v1 + skip raw
bytes, Azure#5012/Azure#5013)
- PowerShell script sync (core-submodule handling)

**Rebase merge** this PR (do not squash) to preserve the release-line
history.

---------

Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Timothee Guerin <tiguerin@microsoft.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:java Issues for @azure-tools/typespec-java emitter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants