[ 
https://issues.apache.org/jira/browse/NIFI-14687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18017668#comment-18017668
 ] 

David Handermann commented on NIFI-14687:
-----------------------------------------

Thanks for the example [~oshpak]. That particular example sounds 
straightforward, it could be reasonable to implement in a custom Processor, but 
it may not be suitable for a generalized JSON Processor in the project. For the 
example you described, the UpdateRecord Processor supports setting the value of 
an identified Record Path, and includes support for conditionals. Have you 
evaluated UpdateRecord for your use case?

> New processor to modify flow file content in JSON format
> --------------------------------------------------------
>
>                 Key: NIFI-14687
>                 URL: https://issues.apache.org/jira/browse/NIFI-14687
>             Project: Apache NiFi
>          Issue Type: Wish
>          Components: Extensions
>    Affects Versions: 2.4.0
>            Reporter: Oleksandr Shpak
>            Priority: Trivial
>
> h2. Use case
> In case when user need to modify JSON flow file content and set the new 
> values of some keys using attribute values, currently it's possible with 
> external scripts or complex schemas only.
> Example. NiFi calls external API, get the result in JSON format. Then calls 
> another API endpoint to get the recent object status. After that the recent 
> status should be set to the specific key (by path) in the original response.
> h2. Processor requirements
>  * Processor should modify JSON content only
>  * User can define one or more attribute names which values will be used to 
> update the flow file content
>  * For every attribute name user should set the path in JSONPath format
>  * Processor should accept the next additional parameter:
>  ** Processing behavior:
>  *** Ignore empty or unset attribute values.
>  *** Assign null value if attribute value is empty or not set



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

Reply via email to