FTL - How to get values of JSON object correctly
<p>I am pretty new in FTL so this may be a stupid question however I wasn't lucky to solve it.</p>

<p>I have a JSON object:</p>

<pre><code> {
    "Q1": "KOŽENÝ VOLANT",
    "Q5": "ZESÍLENÉ ZÁVĚSY KOL",
    "Q6": "AIRBAG SPOLUJEZDCE",
    "M3": "BOČNÍ OCHR - LIŠ MALÉ",
    "Q7": "SERVOŘÍZENÍ ELEKTR",
    "M4": "SP"
 }
</code></pre>

<p>And I need to access this texts on right side.
How I do it:</p>

<pre><code>&lt;#function getModelOptions&gt;
    &lt;#local results = []&gt;
        &lt;#list case.vehicleData.modelOptions?keys as key&gt;
            &lt;#local results = results+[case.vehicleData.modelOptions[key]]&gt;
        &lt;/#list&gt;
    &lt;#return results&gt;
&lt;/#function&gt;
</code></pre>

<p>and after that something like:</p>

<pre><code>&lt;#assign dataVybavaVozidla = getModelOptions() &gt;
&lt;@input.draw2ColumnNoBorderTable nadpis="Výbava vozidla" data=dataVybavaVozidla /&gt;
</code></pre>

<p>This works for me on 90% cases, but in some it just throw me an error:</p>

<pre><code>&gt; ---- FTL stack trace ("~" means nesting-related):
&gt;         - Failed at: #local results = results + [case.vehi...  [in template "path/to/template.ftl" in function "getModelOptions" at line
&gt; 1501, column 25]
&gt;         - Reached through: #assign dataVybavaVozidla = getModelO...  [in template "path/to/template.ftl" at line 674, column 17]
&gt; ----
</code></pre>

<p>I try to compare data in both cases, when it works and when it doesn't work correctly. Both look same. I also try to just </p>

<pre><code>&lt;#list case.vehicleData.modelOptions?keys as key&gt;
    &lt;tr&gt;${key}&lt;/tr&gt;
&lt;/#list&gt;
</code></pre>

<p>which display me my keys correctly :(</p>

<p>EDIT:
Atm it looks like (I can't confirm) is that it can be some special character like <code>&amp;</code> and  <code>null</code> in text.</p>