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

Federico Mariani updated CAMEL-20394:
-------------------------------------
    Summary: camel-jbang wrong transformation when rests and routes tags are 
together  (was: camel-jbang wrong rests and routes transformation)

> camel-jbang wrong transformation when rests and routes tags are together
> ------------------------------------------------------------------------
>
>                 Key: CAMEL-20394
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20394
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jbang
>    Affects Versions: 4.3.0
>            Reporter: Federico Mariani
>            Priority: Major
>
> The following yaml
> {code:yaml}
> - rest:
>     id: rest-c658
>     get:
>       - id: get-2028
>         to: direct:start
> - route:
>     id: route-a41e
>     nodePrefixId: route-7fd
>     from:
>       id: from-131e
>       uri: direct
>       parameters:
>         name: start
>       steps:
>         - setBody:
>             id: setBody-31fe
>             expression:
>               simple:
>                 id: simple-56a9
>                 expression: ${headers.CamelFtpReplyCode}
>         - log:
>             id: log-793d
>             message: ${body}
> {code}
> is transformed, via 
> {code:bash}
> camel transform route --format=xml test.yaml
> {code}
> into the following XML
> {code:xml}
> <camel>
>     <route id="route-a41e" nodePrefixId="route-7fd">
>         <from id="from-131e" uri="direct:start"/>
>         <setBody id="setBody-31fe">
>             <simple>${headers.CamelFtpReplyCode}</simple>
>         </setBody>
>         <log id="log-793d" message="${body}"/>
>     </route>
> <rests>
>     <rest id="rest-c658">
>         <get id="get-2028">
>             <to uri="direct:start"/>
>         </get>
>     </rest>
> </rests>
> </camel>
> {code}
> the _rests_ section does not work as is, in particular the _camel run_ fails 
> with the following error _XmlPullParserException: Unexpected element 
> '{}rests'_.
> Removing <rests> tag, _camel run_ works as expected
> {code:xml}
> <camel>
>     <route id="route-a41e" nodePrefixId="route-7fd">
>         <from id="from-131e" uri="direct:start"/>
>         <setBody id="setBody-31fe">
>             <simple>${headers.CamelFtpReplyCode}</simple>
>         </setBody>
>         <log id="log-793d" message="${body}"/>
>     </route>
>     <rest id="rest-c658">
>         <get id="get-2028">
>             <to uri="direct:start"/>
>         </get>
>     </rest>
> </camel>
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to