tristanhimmelman/AlamofireObjectMapper

How to parse array in object

dieunguyenantony opened this issue · 0 comments

Here my response
{ "Time" : "22\/10\/2019 10:40:57", "ListValue" : null, "Message" : "Can not found data!", "Code" : "01" }
and request
Alamofire.request(apiRouter) .debugLog().validate() .responseArray(keyPath: "ListValue") { (response: DataResponse<[T]>) in if let status = response.response?.statusCode { switch(status) { case 200: guard response.result.isSuccess else { let err: BaseResponseError = BaseResponseError.init(NetworkErrorType.HTTP_ERROR, String(-2), "Error") completion(nil, err) return } completion(response.result.value,nil) default: let err: BaseResponseError = BaseResponseError.init(NetworkErrorType.HTTP_ERROR, String(-2), "Error ") completion(nil, err) } } }
when I execute , i get error ObjectMapper failed to serialize response
but { "Time" : "22\/10\/2019 10:40:57", "ListValue" : [], "Message" : "Can not found data!", "Code" : "01" } work fine
my problem is "ListValue" : [] and "ListValue" : null
Please help me