<p dir="auto">JSON standard (<a href="http://json.org/" rel="nofollow">http://json.org/</a>) say, that any entity can be object or array.<br>
When I try:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="jsonify(['a','b','c', 'd', 'e', 'f'])"><pre class="notranslate"><code class="notranslate">jsonify(['a','b','c', 'd', 'e', 'f'])
</code></pre></div>
<p dir="auto">I got an error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ValueError: dictionary update sequence element #0 has length 8; 2 is required"><pre class="notranslate"><code class="notranslate">ValueError: dictionary update sequence element #0 has length 8; 2 is required
</code></pre></div>
<p dir="auto">I think it is not a correct answer from flask. It should returns a JSON-object with array.</p>
<p dir="auto">I was suprised to find that jsonify(['hello', 'world']) will raise a TypeError even though</p>
<blockquote>
<p dir="auto">[<br>
"hello",<br>
"world"<br>
]</p>
</blockquote>
<p dir="auto">is valid json.</p>
<p dir="auto">I think there should be a check to see if the first argument is a list instance and just do a json dump of the first argument if it is or something like that.</p>