Skip to content

Could not find a field for name x #112

Answered by pdvrieze
elect86 asked this question in Q&A
Discussion options

You must be logged in to vote

When serializing some example data it is clearer. Comment is a string so is by default serialized as attribute, not as element. The error doesn't clarify this (yet). To fix it you need to make comment serialize as element. The easiest way to do that is the @XmlElement(true) annotation. You will also want to set the serial name (or @XmlSerialName) for the registry class (as otherwise the capitalised class name is used).

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pdvrieze
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #110 on November 07, 2022 10:03.