[
https://issues.apache.org/jira/browse/CAMEL-17741?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Nicolas Filotto resolved CAMEL-17741.
-------------------------------------
Resolution: Fixed
> camel-yaml-dsl - Improper way to get the default name of a field annotated
> with XmlElement
> -------------------------------------------------------------------------------------------
>
> Key: CAMEL-17741
> URL: https://issues.apache.org/jira/browse/CAMEL-17741
> Project: Camel
> Issue Type: Task
> Components: camel-yaml-dsl
> Reporter: Nicolas Filotto
> Assignee: Nicolas Filotto
> Priority: Minor
> Fix For: 3.16.0
>
>
> It appears that the plugin *camel-yaml-dsl-maven-plugin* doesn't retrieve the
> default name of a property as the JAXB specification states.
> Indeed, I have the next mapping:
> {code:java}
> @XmlElement
> @Metadata(label = "security")
> private List<SecurityDefinition> securityRequirements = new
> ArrayList<>();{code}
> According the JAXB specification, if a field is annotated with the annotation
> {_}XmlElement{_}, its name should be retrieved from the attribute "name" if
> set otherwise it should use the field name.
> With the current code, I end up with "{_}security{_}" corresponding to the
> value of the attribute "{_}name{_}" of the annotation _XmlRootElement_ on the
> class _SecurityDefinition_ as you can see below:
> {code:java}
> @Metadata(label = "rest,security,configuration", title = "Rest Security")
> @XmlRootElement(name = "security")
> @XmlAccessorType(XmlAccessType.FIELD)
> public class SecurityDefinition {{code}
> According to the specification, this behavior is actually only expected with
> a field annotated with {_}XmlElementRef{_}.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)