When XmlAccessType.NONE is annotated, values annotated with XmlAttribute are not parsed
See original GitHub issueAfter the implementation of #1649, values annotated (in Java) with XmlAttribute are not parsed and must be annotated with XmlElement (which is a nice workaround). As far as I understand it, the annotation of XmlAttribute should also result in parsing the value.
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@ApiModel(description = "A class that describes a user profile")
public class Profile {
@XmlAttribute
@ApiModelProperty(value = "The name", required = true)
private String name;
@XmlElement
@ApiModelProperty(value = "The address", required = true)
private String address;
private String secretKey;
}
Here, address would be parsed, the name would not be parsed.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
JAXB annotations for groovy attribute classes - Stack Overflow
I get the full list of desired skills printed (5 of them), so I know the values are in the database already. To...
Read more >Guide to JAXB Annotations - HowToDoInJava
FIELD – Every non-static, non-transient field in a JAXB-bound class will be automatically bound to XML, unless annotated by XmlTransient .
Read more >XmlAccessType (Java Platform SE 8 ) - Oracle Help Center
Every non static, non transient field in a JAXB-bound class will be automatically bound to XML, unless annotated by XmlTransient . NONE. None...
Read more >Jakarta XML Binding
However it is a non goal in Jakarta XML Binding specification, ... either explicitly or via default mapping, with the mapping annotation @XmlAttribute...
Read more >JAXB hello world example - Mkyong.com
XmlAccessType ; import jakarta.xml.bind.annotation. ... public fields, and JAXB annotated non-public fields for XML conversion.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@fehguy can you please merge this PR #2409 to fix this issue. Thanks !
This is a bug–if you have time for a PR for a test and/or fix, it’d be appreciated.