Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-19758

Transforming a json body via JSONPath returns a string where the json object keys aren't quoted

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • fuse-7.11.1-GA
    • fuse-7.7-GA, fuse-7.10-GA, fuse-7.8-GA, fuse-7.9-GA, fuse-7.11-GA
    • Camel
    • None
    • False
    • None
    • False
    • % %
    • +
    • Automated
    • Workaround Exists
    • Hide

      Do not use any return type with jsonpath

      .setBody().jsonpath("$.d.results")
      Show
      Do not use any return type with jsonpath .setBody().jsonpath( "$.d.results" )
    • Hide

      Reproducer attached.

      Test demonstrates the error. You can build with mvn clean install -DskipTests to build then run. Copy the multiple-item-array.json and single-item-array.json files into the work directory to see the difference in parsing single vs. multiple item arrays.

      Show
      Reproducer attached. Test demonstrates the error. You can build with mvn clean install -DskipTests to build then run. Copy the multiple-item-array.json and single-item-array.json files into the work directory to see the difference in parsing single vs. multiple item arrays.

      When extracting a JSON element via JSONPath from a JSON array with a length of "1", an unquoted value is returned, resulting in deserialization issues.

      A multi-element array containing the same values as one of the elements in the array is parsed fine with no serialization errors.

              rnetuka@redhat.com Radovan Netuka
              rhn-support-dhawkins Duane Hawkins
              Federico Mariani Federico Mariani
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: