Skip to content

fix: Restore member xmlName resolution in XML builder root entry pt#344

Merged
jterapin merged 1 commit into
decaffrom
smithy-xml-fix
Jun 15, 2026
Merged

fix: Restore member xmlName resolution in XML builder root entry pt#344
jterapin merged 1 commit into
decaffrom
smithy-xml-fix

Conversation

@jterapin

Copy link
Copy Markdown
Contributor

Summary

The build entry point only checks shape.target.traits['smithy.api#xmlName'] for the root element name, but doesn't check shape.traits['smithy.api#xmlName'] (the member-level xmlName). This was a regression introduced in #342 — the old code checked ref.location_name first, which callers used to pass the resolved member xmlName.

This matters for REST XML httpPayload members where the member's xmlName overrides the target shape's xmlName (e.g., member has xmlName: "Hola", target has xmlName: "Hello" — should serialize as <Hola>).

Changes

  • Check shape.traits['smithy.api#xmlName'] before shape.target.traits['smithy.api#xmlName'] in the builder's root resolution — consistent with how nested members are already resolved via the location_name helper.

Test case

HttpPayloadWithMemberXmlName protocol test — member xmlName should win over target xmlName for the root element. All protocol tests passes.

@jterapin jterapin marked this pull request as ready for review June 15, 2026 21:12
@jterapin jterapin merged commit 1efcfb3 into decaf Jun 15, 2026
31 checks passed
@jterapin jterapin deleted the smithy-xml-fix branch June 15, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants