For my APIManager.swift
APIManager.manager.request(urlEncoded, method: useMethod, parameters: params, encoding: requestEncoding, headers: headers)
.validate(statusCode: 200..<300)
.responseJSON { response in
switch response.result {
case .success(let json):
///
case .failure(let error):
///
}
}
And my api json response
{
"code": 200,
"status": "success",
"response_data": {
"name": "testing"
}
}
my model
struct TesterModel: Codable {
var name: String
}
I need to map object with codeable protocol but map only on reponse_data
field from api response. How to map it from .responseJSON ?