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

Make it possible for JsonPath to suppress PathNotFoundException

    Details

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

      Description

      It should be possible to suppress exceptions when evaluating JsonPath's.

      See http://camel.465427.n5.nabble.com/How-to-suppress-exceptions-from-Jsonpath-expressions-td5767384.html

      There are 2 options
      1. Make it the default behaviour, so a null value will be returned instead of throwing an PathNotFoundException when evaluating json path expressions and the path is not found. I have a working patch for that here https://github.com/pax95/camel/commit/e09bd00d9199c88787f0acb0d2ea8c86e6a1bba9 that I can do a PR on.

      2. Make it configurable on the JsonPath component so you can enable/disable it on demand. This would also make it possible to expose other options from com.jayway.jsonpath.Option if they make sense. More work is require to make it available as both xml and java dsl.

      Currently I'm at bit overloaded to do a PR on 2 if that is the preferred option, so if any want to take over It will be fine.

      If option 1 is ok I'll create a PR.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                davsclaus Claus Ibsen
                Reporter:
                preben Preben Asmussen
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: