Skip to content

Encode collection wrapper element name via XmlNameProcessor - #918

Open
Sahana2524 wants to merge 2 commits into
FasterXML:3.xfrom
Sahana2524:wrapper-name-encode
Open

Sahana2524 wants to merge 2 commits into
FasterXML:3.xfrom
Sahana2524:wrapper-name-encode

Conversation

@Sahana2524

Copy link
Copy Markdown
Contributor

Collection wrapper element name skips the XmlNameProcessor

startWrappedValue() writes the wrapper element straight to the Stax writer, so with a non-passthrough processor the wrapper name comes out verbatim while the wrapped item names (which go through writeName() -> encodeContentName()) are encoded. Since the reader decodes every element name, a default wrapped List serialized with newAlwaysOnBase64Processor() then throws StreamReadException on read (the raw wrapper name is not valid base64), and a wrapper name holding an XML-invalid character such as a space emits non-well-formed XML. Routing the wrapper name through encodeContentName() first keeps it symmetric with the item names; passthrough output is unchanged.

@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 77.70% 📈 +0.010%
Branches branches 70.97% 📈 +0.000%

Coverage data generated from JaCoCo test results

1 similar comment
@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 77.70% 📈 +0.010%
Branches branches 70.97% 📈 +0.000%

Coverage data generated from JaCoCo test results

@cowtowncoder cowtowncoder changed the title encode collection wrapper element name via XmlNameProcessor Encode collection wrapper element name via XmlNameProcessor Sep 28, 2026
@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 77.70% 📈 +2.750%
Branches branches 70.97% 📈 +1.470%

Coverage data generated from JaCoCo test results

This branch has not been deployed

No deployments
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