I'm building parameters to send it to a server. So I need to transform my array of custom object to JSON.
tried this:
let data = try? JSONSerialization.data(withJSONObject: fastForm.route, options: .prettyPrinted)
let str = String(bytes: data!, encoding: .utf8)!
Getting error from the server Invalid supplied for each()
edited: fastForm.route is array of object Route -> [Route]
struct Route: Codable {
var latitude: String
var longitude: String
var waitingMinutes: String!
var description: String!
}