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

camel-jsonpath - ResultType List should store single element into a List so it can be used afterwards with Split EIP

    XMLWordPrintableJSON

Details

    • Unknown

    Description

      We are supporting the Split EIP splitting a map out of the box from Camel 3.13.0 https://issues.apache.org/jira/browse/CAMEL-17101. However, it changes the behavior when using jsonpath, as the jsonpath always evaluates the message to Map.

      // code placeholder
      from("direct:start")
              .split().jsonpath("$.store.books")
              .to("log:book", "mock:result"); 

      My suggestion is to allow enable and disable this behavior. Look at this example

      // code placeholder
      from("direct:start")
              .split()
              .splitMapEntry(true)
              .jsonpath("$.store.books")
              .to("log:book", "mock:result"); 

       

      Let me know if it makes sense. If so, I can get this issue and send a PR. 

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rhuanrocha Rhuan Rocha
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: