This is the JSON
[{ "start_hour": "08:00:00", "end_hour": "10:00:00", "call_duration": "30" }]
I tried to parse as follows
class DoctorAvailablityResponseData: Mappable {
var startDateHour : String?
var callDuration : Int?
var endDateHour : String?
required init?(_ map: Map){
}
func mapping(map: Map) {
callDuration <- map["call_duration"]
endDateHour <- map["end_hour"]
startDateHour <- map["start_hour"]
}
}
and
let user = Mapper<ResponseDoctorAvailablity>().map(response.result.value)
But it breaks while parsing , found nil value .