Skip to content

When XmlAccessType.NONE is annotated, values annotated with XmlAttribute are not parsed #1847

@wapolinar

Description

@wapolinar

After 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions