I am attempting to upgrade to Alamofire 5.x and one line has me blocked:
private static func request<T: Codable> (_ urlConvertible: URLRequestConvertible) -> Observable<T> {
return Observable<T>.create { observer in
let request = AF.request(urlConvertible).responseJSON { (response: DataResponse<T>) in ... }
}
}
The response does not seem to be a single type anymore as XCode is complaining of "Generic type 'DataResponse' specialized with too few type parameters (got 1, but expected 2)"
Thoughts on what I am doing wrong?