Mark Payne created NIFI-12480:
---------------------------------

             Summary: Improve handling of embedded JSON records
                 Key: NIFI-12480
                 URL: https://issues.apache.org/jira/browse/NIFI-12480
             Project: Apache NiFi
          Issue Type: Improvement
          Components: Core Framework, Extensions
            Reporter: Mark Payne
            Assignee: Mark Payne


It proves to be difficult to treat embedded JSON elements as Strings. There are 
times when this is necessary, such as when pushing to a database that declares 
a field of type JSON or interacting with a web service that expects incoming 
JSON as a String. However, there's no easy way to do this in NiFi today.

Instead, what typically happens is that the Record gets converted to a String 
via a call to {{toString()}} and that produces something like 
{{{}MapRecord[name=John Doe, color=blue]{}}}, which is not helpful.

However, when a JSON Reader is used, we already have a JSON representation of 
the Record in the record's SerializedForm. When {{toString()}} is called, we 
should always use the SerializedForm of a Record, if it is available and only 
fall back to the given version.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to