Nick dos Remedios created NIFI-12121:
----------------------------------------
Summary: 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
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.
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)