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

YAML DSL is sensitive to key ordering

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.9.0
    • 3.10.0
    • camel-yaml-dsl
    • None
    • Unknown

    Description

      Related to https://github.com/apache/camel-k/issues/2203

       

      This does not seem to work in YAML DSL:

       

       - from:
          steps:
          - to:
              parameters:
                showHeaders: "true"
              uri: "log:info"
          uri: "timer:tick"
      

       

      Error:

       

      [1] Caused by: java.lang.IllegalStateException: url must be set before setting properties
      [1] 	at org.apache.camel.dsl.yaml.deserializers.ModelDeserializers$ToDefinitionDeserializer.setProperty(ModelDeserializers.java:14189)
      [1] 	at org.apache.camel.dsl.yaml.deserializers.ModelDeserializers$ToDefinitionDeserializer.setProperty(ModelDeserializers.java:14141)
      [1] 	at org.apache.camel.dsl.yaml.common.YamlDeserializerBase.setProperties(YamlDeserializerBase.java:103)
      [1] 	at org.apache.camel.dsl.yaml.common.YamlDeserializerBase.construct(YamlDeserializerBase.java:51)
      [1] 	at org.apache.camel.k.loader.yaml.YamlSourceLoaderDeserializerResolver$ToDeserializer.construct(YamlSourceLoaderDeserializerResolver.java:65)
      [1] 	at org.apache.camel.dsl.yaml.common.YamlDeserializationContext$2.construct(YamlDeserializationContext.java:194)
      [1] 	at org.apache.camel.dsl.yaml.deserializers.ProcessorDefinitionDeserializer.construct(ProcessorDefinitionDeserializer.java:36)
      [1] 	at org.apache.camel.dsl.yaml.common.YamlDeserializationContext$1.construct(YamlDeserializationContext.java:152)
      [1] 	at org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asType(YamlDeserializerSupport.java:290)
      [1] 	at org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asCollection(YamlDeserializerSupport.java:268)
      [1] 	at org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asFlatCollection(YamlDeserializerSupport.java:249)
      [1] 	at org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asFlatList(YamlDeserializerSupport.java:223)
      [1] 	at org.apache.camel.dsl.yaml.deserializers.RouteFromDefinitionDeserializer.setProperties(RouteFromDefinitionDeserializer.java:76)
      [1] 	at org.apache.camel.dsl.yaml.deserializers.RouteFromDefinitionDeserializer.setProperties(RouteFromDefinitionDeserializer.java:36)
      [1] 	at org.apache.camel.dsl.yaml.common.YamlDeserializerBase.construct(YamlDeserializerBase.java:51)
      [1] 	at org.apache.camel.k.loader.yaml.YamlSourceLoaderDeserializerResolver$RouteFromDeserializer.construct(YamlSourceLoaderDeserializerResolver.java:57)
      [1] 	at org.apache.camel.dsl.yaml.common.YamlDeserializationContext$2.construct(YamlDeserializationContext.java:194)
      [1] 	at org.snakeyaml.engine.v2.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:140)
      [1] 	at org.snakeyaml.engine.v2.constructor.BaseConstructor.constructObject(BaseConstructor.java:128)
      [1] 	at org.snakeyaml.engine.v2.constructor.BaseConstructor.constructSequenceStep2(BaseConstructor.java:206)
      [1] 	at org.snakeyaml.engine.v2.constructor.BaseConstructor.constructSequence(BaseConstructor.java:199)
      [1] 	at org.snakeyaml.engine.v2.constructor.StandardConstructor$ConstructYamlSeq.construct(StandardConstructor.java:340)
      [1] 	at org.snakeyaml.engine.v2.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:140)
      [1] 	at org.snakeyaml.engine.v2.constructor.BaseConstructor.constructObject(BaseConstructor.java:128)
      [1] 	at org.snakeyaml.engine.v2.constructor.BaseConstructor.construct(BaseConstructor.java:87)
      [1] 	... 32 more 

       

      Changing the order to this, fixes:

      - from:
          uri: "timer:tick"
          steps:
          - to:
              uri: "log:info"
              parameters:
                showHeaders: "true" 

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            lb Luca Burgazzoli
            nferraro Nicola Ferraro
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment