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

Daniel Stieglitz commented on NIFI-12456:
-----------------------------------------

[~markap14] I would like to confirm with you which processors and/or controller 
services these should be applied to.

Currently the JSON NIFI processors  I see that read and write JSON are:
 * EvaluateJsonPath
 * FlattenJson
 * JoltTransformJSON
 * JoltTransformRecord
 * JSLTTransformJSON
 * SplitJson
 * ValidateJson

    processors that write JSON are:
 *   AttributesToJSON

    and the controller services which read JSON are:
 * JsonPathReader
 * JsonTreeReader

 

Of the aforementioned, only ValidateJson, JsonPathReader and JsonTreeReader 
implement the ability to support comments (Java ones). I assume the changes you 
have suggested should to apply as many of theses processors and controller 
services as possible. I do not think we can do this for FlattenJson as its 
using a different library than Jackson. Do you agree with this and are there 
any other processors and/or controller services I have missed?

> Improve leniency of JSON readers and flexibility of JSON Writer
> ---------------------------------------------------------------
>
>                 Key: NIFI-12456
>                 URL: https://issues.apache.org/jira/browse/NIFI-12456
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Extensions
>            Reporter: Mark Payne
>            Assignee: Daniel Stieglitz
>            Priority: Major
>
> Currently, we adhere to the JSON specification fairly strictly, with the 
> exception of allowing for "JSON Lines" / ndjson / ldjson.
> However, the Jackson library allows for several {{Features}} that we do not 
> expose, which may be helpful for handling data that does not strictly adhere 
> to the schema, or where there are preferences in serialization.
> For example, {{JsonParser.Feature}} allows for the ability to allow comments 
> in JSON (to include lines beginning with {{{}//{}}}, {{{}/*{}}}, and "YAML 
> Style" comments (#)). Additionally, it allows for single-quotes for field 
> names or no quoting at all. While these do not adhere to the specification, 
> they are common enough for the parser to support them, and we should too.
> Similarly, on the serialization side, we have had requests to support writing 
> decimal values without use of scientific notation, which can be achieved by 
> enabling the {{WRITE_BIGDECIMAL_AS_PLAIN}} feature.
> We should expose these options on the JsonTreeReader and the JSON Writer. I 
> don't know of any downside to enabling the leniency / non-standard options, 
> so it probably makes sense to simply enable them all by default. Though there 
> is argument for introducing a new "Parsing Leniency" option that allows the 
> user to disable these features.



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

Reply via email to