title: Convert array of dictionaries to JSON Format
body: <p>my api expects to receive JSON data in below form</p>
  
  <pre><code>{
    "user_contacts" : [
      {
        "friend_list" : "+928885555512",
        "user_id" : "1"
      },
      {
        "friend_list" : "+925555648583",
        "user_id" : "1"
      },
      {
        "friend_list" : "+925555228243",
        "user_id" : "1"
      }
    ]
  }
  </code></pre>
  
  <p>i have created this data through array of dictionaries and its working fine and it is stores in <code>Data</code> type Variable. As alamofire requires <code>[String: Any]</code> type of parameter so i have to convert that data into desired format so i tried this:</p>
  
  <pre><code>let my_dict = try JSONSerialization.jsonObject(with: jsonData!, options: []) as! [String: Any]
  </code></pre>
  
  <p>but when print this <code>my_dict</code> before call alamofire. it seems that it is not a correct json see below... with something like that: <code>__NSArrayI 0x618000271dc0&gt;</code></p>
  
  <pre><code>["user_contacts": &lt;__NSArrayI 0x618000271dc0&gt;(
  {
      "friend_list" = "+928885555512";
      "user_id" = "1";
  },
  {
      "friend_list" = "+925555228243";
      "user_id" = "1";
  },
  {
      "friend_list" = "+925554787672";
      "user_id" = "1";
  }
  )
  ]
  </code></pre>
  
  <p>So how can i make this correct json form?
  what i am doing wrong?</p>
  
  <p>Updated:</p>
  
  <pre><code>let updated_User_No :[String:Any]=["friend_list": self.new_convert_telephone_no,"user_id": user_no];
  
                  user_outer_arrary.append(updated_User_No);
  
                  user_inner_array=["user_contacts": user_outer_arrary]
  </code></pre>
  
  <p>it Should be look like this:</p>
  
  <pre><code>{
    "user_contacts" : [
      {
        "friend_list" : "+928885555512",
        "user_id" : "1"
      },
      {
        "friend_list" : "+925555648583",
        "user_id" : "1"
      }
    ]
  }
  </code></pre>