<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Nifi AttributesToJSON makes everything strings in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Nifi-AttributesToJSON-makes-everything-strings/m-p/283555#M210739</link>
    <description>&lt;P&gt;I have JSON messages in the flowfiles, and I'm putting a subset of the JSON elements into attributes using EvaluateJSONPath. &amp;nbsp; The issue is that when I use AttributesToJSON,&amp;nbsp;&lt;EM&gt;all&lt;/EM&gt; the elements get wrapped in quotes, so the JSON fields that are/were arrays now are just strings that happen to have square brackets in them, and quotes around the strings in the array are escaped. &amp;nbsp; How do I preserve the "non-stringiness" of my JSON through these operations?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Input JSON:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;{"customer_id": 1234567, "vckey_list": ["test value"]}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I pull both of those fields into attributes using EvaluateJSONPath, and then user AttributesToJSON with content-flowfile and this is the output. &amp;nbsp; Obviously the strings within the array are escaped because the array itself is quoted, as is the thing that was a number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output JSON after 2 operations:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;{"customer_id": "1234567", "vckey_list": "[\"test value\"]"}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My desired output would be identical to the original. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;{"customer_id": 1234567, "vckey_list": ["test value"]}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm sure I've missed something simple to make these operations commute.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Nov 2019 06:36:29 GMT</pubDate>
    <dc:creator>craignelson7007</dc:creator>
    <dc:date>2019-11-21T06:36:29Z</dc:date>
  </channel>
</rss>

