Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-20394

camel-jbang wrong transformation when rests and routes tags are used together

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.3.0
    • 4.4.0
    • camel-jbang
    • None
    • Unknown

    Description

      The following 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}
      

      is transformed, via

      camel transform route --format=xml test.yaml
      

      into the following 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>
      

      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

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

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            Federico Mariani Federico Mariani
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: