I'm trying to post an object like so:
{
"simulation" : { },
"simOptions" : [
{ },
{ }
]
}
and tried posting it by calling my SimulationRepository class:
SimulationsRepository().confirmSimulation(params: parameters) { (response) in
if let error = checkError(response) {
self.hideLoading()
self.showAlert(error)
return
}
guard let simsArray = SimulacaoArray(responseObject: response.result.value) else {
let error = response.error.debugDescription
self.hideLoading()
self.showAlert(error)
return
}
print(simsArray.simulation.count)
}
I've tried the solutions here Sending json array via Alamofire and here Alamofire: Send JSON with Array of Dictionaries, but can't get the array of dictionaries to be converted properly.