Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-5887

JOLTTransformJSON advanced window JSON format validation should accept EL without double quote

Agile BoardAttach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.7.0
    • None
    • Extensions

    Description

      JOLTTransformJSON advanced configuration window allows user to design a Jolt spec using NiFi EL. Also it does provide a feature to set FlowFile attributes to confirm conversion result for testing.

      However, the advanced window spec JSON format validation doesn't allow EL expression without double quote. Because of this, user can not try a JOLT spec using EL which references a FlowFile attribute having a valid JSON object. See details below.

      It would be more user friendly if the advanced window allows a Jolt spec even if it is not a valid JSON format. Probably adding a toggle switch to disable JSON validation might be a solution.


      i have a attribute (that produced by a REST service and catched by invokeHTTP processor) in JSON format like this:

      test => {"key":"value"}

      and then i want to put it in flows JSON content using JOLT processor, my content is something like this:

      { "id": 123, "user": "foo" }

      and my JOLT specification is this:

      [{ "operation": "default", "spec": { "interest": "${test}" } }]

      the problem is here that, in JOLT advanced window with test attribute nifi cannot put json object and shown this error:

      "Error occurred during transformation"

      and when run processor this detailed error is become alerted:

      "unable to unmarshal json to an object"


      my desired result is this:

      { "id": 123, "user": "foo", "interest": {"key":"value"} }

      is this a bug or am i wrong?

      Attachments

        Activity

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

          People

            Unassigned Unassigned
            mehrdad22 meh

            Dates

              Created:
              Updated:

              Slack

                Issue deployment