[
https://issues.apache.org/jira/browse/NIFI-12121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michael W Moser updated NIFI-12121:
-----------------------------------
Fix Version/s: 2.latest
Status: Patch Available (was: In Progress)
> Update JSLTTransformJSON to output null-value JSON objects
> ----------------------------------------------------------
>
> Key: NIFI-12121
> URL: https://issues.apache.org/jira/browse/NIFI-12121
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Extensions
> Affects Versions: 1.23.2
> Reporter: Nick dos Remedios
> Assignee: Michael W Moser
> Priority: Minor
> Fix For: 2.latest
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> The current implementation of the JSLTTransformJSON processor is configured
> using the default {{com.schibsted.spt.data.jslt.Parser}} "filter"
> configuration that results in the removal of any JSON objects where the value
> is `null`.
> When processing data in Nifi with the "infer schema" option for a
> reader/writer controller service, this results in some {*}data not conforming
> to the "original" schema{*}, once it passed through the JSLTTransformJSON
> processor. As any JSON objects with a null value are removed from the final
> JSON output. See [this issue|https://github.com/schibsted/jslt/issues/308]
> that illustrates this problem.
> The [JSLT API allows for the ability to
> configure|https://github.com/schibsted/jslt/blob/master/docs/api.md#object-key-filter]
> whether null-value objects are retained or remove. I've checked the Nifi
> JSLTTransformJSON source and it does not currently set
> {{.withObjectFilter(filter)}} on the {{Parse}} object.
> I'd like to see the JSLTTransformJSON processor be updated with a
> user-selectable option to include null-value objects in the output (or not).
> Which would optionally set {{{}Parser.withObjectFilter(true){}}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)