Skip to content

Apply XmlNameProcessor to unwrapped ObjectNode root element name - #887

Open
Sahana2524 wants to merge 2 commits into
FasterXML:3.xfrom
Sahana2524:unwrapped-root-name-processor
Open

Apply XmlNameProcessor to unwrapped ObjectNode root element name#887
Sahana2524 wants to merge 2 commits into
FasterXML:3.xfrom
Sahana2524:unwrapped-root-name-processor

Conversation

@Sahana2524

Copy link
Copy Markdown
Contributor

Root element name skips the configured XmlNameProcessor

With UNWRAP_ROOT_OBJECT_NODE (on by default) the root element name is taken from the ObjectNode property name and written as-is, so a name that gets escaped when it lands as a child element is not escaped when it lands as the root: {"$ I am <fancy>! &;": {"id": 13}} comes out as <$ I am <fancy>! &;><id>13</id></$ I am <fancy>! &;>, whereas the same key one level down becomes <__I_am__fancy_____>. Since that name comes from content rather than from a POJO property, routing it through the generator's processor seemed like the right layer, and it also makes the WRAP_ROOT_ELEMENT_NAME / UNWRAP_ROOT_OBJECT_NODE pairing round-trip a root name that had to be escaped, which is what the javadoc promises. Default passthrough processor output is unchanged.

@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 73.63% 📈 +0.000%
Branches branches 68.44% 📈 +0.040%

Coverage data generated from JaCoCo test results

1 similar comment
@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 73.63% 📈 +0.000%
Branches branches 68.44% 📈 +0.040%

Coverage data generated from JaCoCo test results

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.

1 participant