title: Invalid type in JSON write (_SwiftValue) using Alamofire
body: <p>I have tried a lot of things now and are still getting:
  <em>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid type in JSON write (_SwiftValue)'</em></p>
  
  <p>UPDATE:
  I scan a barcode and save the info:</p>
  
  <pre><code>let calendar = Calendar.current
  let expiryDate = (calendar as NSCalendar).date(byAdding: .month, value: 3, to: Date(), options: [])?.description
  
  let barcode = BarcodeData(barcodeValue: value,
                            datetime: dateTime,
                            expiryDate: expiryDate!,
                            latitude: latitude.description,
                            longitude: longitude.description,
                            status: txtStatus.text!,
                            type: txtType.text!,
                            extraText: "")
  </code></pre>
  
  <p>Object are then mapped to a JSON string, it seems that the slashes (/) are added by this function:</p>
  
  <pre><code>let jsonBarcode = Mapper&lt;BarcodeData&gt;().toJSONString(barcode)
  </code></pre>
  
  <p>The barcode are then added to a list of String:</p>
  
  <pre><code>barcodeDataList.append(jsonBarcode)
  </code></pre>
  
  <p>When I click a button I invoke the web service, that anticipate parameters in the form of: </p>
  
  <pre><code>let testParams : Parameters =
      [ "udid": "my_udid",
         "data": jsonArray
      ]
  </code></pre>
  
  <p>jsonArray consist of an array of the BarcodeData-object(s) as seen above.</p>
  
  <p>Communication with the web service looks like:</p>
  
  <pre><code>Alamofire.request(url, method: .post, parameters: testParams, encoding: JSONEncoding.default).validate().responseJSON { response in
  
                  switch response.result {
                  case .success:
                      print("Validation successful")
  
                      if let json = response.result.value {
                          print("JSON: \(json)")
                      }
  
                  case .failure(let error):
                      print("Error: \(error)")
                  }
              }
  </code></pre>
  
  <p>The following is passed to the ws:</p>
  
  <pre><code>    ["udid": "\"001-my_udid\"", "data": [
      "{\"latitude\":\"0.0\",\"status\":\"Empty\",\"datetime\":\"2016-09-20 05:10\",\"longitude\":\"0.0\",\"type\":\"ABC123\",\"barcodevalue\":\"123456\"}"
  ]]
  </code></pre>
  
  <p>The json array for "data" validates at jsonlint.com and the response from the server is in the form of a json object like:</p>
  
  <pre><code>{result: "Data successfully received"}
  </code></pre>