Creating a Json array in Scala
<p>I'm trying to create a Json object like so</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>{
  "Field1": [{}, {}, {}, {}],
  "Field2": [{}, {}, {}],
  "Field3": {}
}</code></pre>
</div>
</div>
</p>

<p>Typically in Java I could achieve this by (specifically using google simple json)</p>

<ol>
<li>Creating JSON arrays for field1 and field2,</li>
<li>Creating a JSON Object for Field3</li>
<li>Combine the above 3 into another JSONObject</li>
</ol>

<p>The results for the above are coming from separate processes, I need to return a combined json object</p>

<p>I'm confused how to achieve the same in Scala, I tried multiple libraries and approaches. The latest I'm trying is json4s. I thought I could</p>

<ol>
<li>Iterate through a list of string and put them in a "json array"</li>
<li>Add the above array into another "json object" with a key</li>
<li>Return the combined json object</li>
</ol>

<p>I thought this will be as straightforward as it is in Java, am I missing something obvious? (I am Scala newbie).</p>

<p>Any help would be much appreciated.</p>