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

ASF GitHub Bot commented on NIFI-4320:
--------------------------------------

Github user mattyb149 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2114#discussion_r136141075
  
    --- Diff: 
nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-processors/src/main/java/org/apache/nifi/processors/cassandra/QueryCassandra.java
 ---
    @@ -492,6 +492,8 @@ protected static String getJsonElement(Object value) {
                 SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd 
HH:mm:ssZ");
                 dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
                 return "\"" + dateFormat.format((Date) value) + "\"";
    +        } else if (value instanceof String) {
    +            return "\"" + ((String) value).replaceAll("\"", "\\\\\"") + 
"\"";
    --- End diff --
    
    Should we use StringEscapeUtils.escapeJson() here? 


> Processor QueryCassandra doens't escape double-quote when output format is 
> JSON
> -------------------------------------------------------------------------------
>
>                 Key: NIFI-4320
>                 URL: https://issues.apache.org/jira/browse/NIFI-4320
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 1.3.0
>         Environment: Ubuntu 14.05/Java 8 Oracle/Cassandra 3.4
>            Reporter: Jean-Louis
>            Assignee: Pierre Villard
>              Labels: cassandra, json
>
> When the output format is JSON, if a content contains double-quote ("), 
> they're not escape! So, the produced JSON malformed



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to