Create JSON array and JSON Object in swift
<p>I want do this JSON in Swift. But i cant do this.... </p>

<pre><code>{
    "room": "Platinum",
    "products": [{
        "name": "Agua",
         "quantity": 2
},
{   
    "name":"Cafe",
    "quantity": 4
}],
    "observation": "",
    "date": "2016-08-15 12:00:00"
}
</code></pre>

<p>My swift code returns this:</p>

<pre><code>{
    date = "2016-08-25 18:16:28 +0000";
    observation = "";
    products =     (
            {
                name = cafe;
                quantity = 1;
            }
    );
    room = Platinium;
</code></pre>

<p>This is my code:</p>

<pre><code>let para:NSMutableDictionary = NSMutableDictionary()
let prod: NSMutableDictionary = NSMutableDictionary()

para.setValue(String(receivedString), forKey: "room")
para.setValue(observationString, forKey: "observation")
para.setValue(stringDate, forKey: "date")

for product in products{
    prod.setValue(product.name, forKey: "name")
    prod.setValue(product.quantity, forKey: "quantity")
    para.setObject([prod], forKey: "products")
}
</code></pre>

<p>This is my input:</p>

<pre><code>{
    name = coffe;
    quantity = 2;
}
{
    name = cappuccino;
    quantity = 1;
}
</code></pre>

<p>This is output </p>

<pre><code>{
    date = "2016-08-25 18:52:30 +0000";
    observation = "";
    products =     (
            {
                name = cappuccino;
                quantity = 1;
            }
    );
    room = Platinium;
}
</code></pre>

<p>I created a request to send the two products, but the code prints only the last product.</p>