You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Nicolas Filotto (Jira)" <ji...@apache.org> on 2022/03/04 08:20:00 UTC

[jira] [Assigned] (CAMEL-17741) camel-yaml-dsl - Improper way to get the default name of a field annotated XmlElement with

     [ https://issues.apache.org/jira/browse/CAMEL-17741?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicolas Filotto reassigned CAMEL-17741:
---------------------------------------

    Assignee: Nicolas Filotto

> camel-yaml-dsl - Improper way to get the default name of a field annotated XmlElement with 
> -------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-17741
>                 URL: https://issues.apache.org/jira/browse/CAMEL-17741
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-yaml-dsl
>            Reporter: Nicolas Filotto
>            Assignee: Nicolas Filotto
>            Priority: Major
>             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)