title: Getting invalid JSON array from array of dictionaries in swift
body: <p>I want to create JSON array string from array that I have. But I am getting invalid JSON.<br/>
  This is what I want:</p>
  
  <pre><code>[
      {
          "validationCode": null,
          "FirstName": "Samer",
          "LastName": "Shame",
          "MobileNumber": "0991992993",
          "SimNumber": null,
          "Email": null,
          "PhoneNumber": "0991992994",
          "Name": "Abo Alshamat",
          "ID": 1
      },
      {
          "validationCode": null,
          "FirstName": "Ahmad",
          "LastName": "Ali",
          "MobileNumber": "0992993994",
          "SimNumber": null,
          "Email": null,
          "PhoneNumber": "0992993995",
          "Name": "AL-Kamal",
          "ID": 2
      }
  ]
  </code></pre>
  
  <p>And this is what I get:</p>
  
  <pre><code>[
      [
          "validationCode": null,
          "FirstName": "Samer",
          "LastName": "Shame",
          "MobileNumber": "0991992993",
          "SimNumber": null,
          "Email": null,
          "PhoneNumber": "0991992994",
          "Name": "Abo Alshamat",
          "ID": 1
      ],
      [
          "validationCode": null,
          "FirstName": "Ahmad",
          "LastName": "Ali",
          "MobileNumber": "0992993994",
          "SimNumber": null,
          "Email": null,
          "PhoneNumber": "0992993995",
          "Name": "AL-Kamal",
          "ID": 2
      ]
  ]
  </code></pre>
  
  <p>This is code:</p>
  
  <pre><code>var data = [NSDictionary]()
  for item in someList {
      var d = ["validationCode": null,
              "FirstName": item.prop1,
              "LastName": item.prop2,
              "MobileNumber": item.prop3...]
  
      data.append(d)
  }
  var bytes = NSJSONSerialization.dataWithJSONObject(data, options: NSJSONWritingOptions.allZeros, error: nil)
  var jsonObj = NSJSONSerialization.JSONObjectWithData(bytes!, options: nil, error: nil) as! [Dictionary&lt;String, String&gt;]
  </code></pre>
  
  <p>What I should do to get standard JSON format?</p>