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

camel-jsonpath - Add support for simple functions

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.18.0
    • Component/s: camel-jsonpath
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      See SO
      http://stackoverflow.com/questions/38609231/can-i-use-camel-simple-expression-inside-jsonpath-language

      We can roll our own predicates in jsonpath where you can use ? as the placeholder. The trick would be to either inline the functions in the string, and then do our own pre-parsing to replace those predicates to ?, eg

      "$.person[?(@.role=='${headers.role}')]"
      

      gets pre-parsed as

      "$.person[?(@.role=='?')]"
      

      And then we know that ${headers.role} is the simple funktion to execute as the predicate.

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              davsclaus Claus Ibsen
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: