[
https://issues.apache.org/jira/browse/CAMEL-20394?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-20394.
---------------------------------
Resolution: Fixed
> camel-jbang wrong transformation when rests and routes tags are used 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
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 4.4.0
>
>
> 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)