forked from loafle/openapi-generator-original
[swift5] fix compile error from Alamofire 5.10 - cast Parameter type to avoid recursion (#19908)
* cast type to avoid unintended recursive call * update samples
This commit is contained in:
parent
c6dbf0870c
commit
1248d7a103
@ -408,6 +408,8 @@ extension JSONDataEncoding: ParameterEncoding {
|
|||||||
public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest {
|
public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest {
|
||||||
let urlRequest = try urlRequest.asURLRequest()
|
let urlRequest = try urlRequest.asURLRequest()
|
||||||
|
|
||||||
return encode(urlRequest, with: parameters)
|
// Alamofire 5.10 changed type of Parameters so that it is no longer equivalent to [String: Any]
|
||||||
|
// cast this type so that the call to encode is not recursive
|
||||||
|
return encode(urlRequest, with: parameters as [String: Any]?)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -408,6 +408,8 @@ extension JSONDataEncoding: ParameterEncoding {
|
|||||||
public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest {
|
public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest {
|
||||||
let urlRequest = try urlRequest.asURLRequest()
|
let urlRequest = try urlRequest.asURLRequest()
|
||||||
|
|
||||||
return encode(urlRequest, with: parameters)
|
// Alamofire 5.10 changed type of Parameters so that it is no longer equivalent to [String: Any]
|
||||||
|
// cast this type so that the call to encode is not recursive
|
||||||
|
return encode(urlRequest, with: parameters as [String: Any]?)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user