From ecb10e7aa1b38a25a9ac9fc1bb3f3aa319353bcb Mon Sep 17 00:00:00 2001 From: ThibaultBee Date: Mon, 21 Oct 2024 08:35:01 +0000 Subject: [PATCH] fix(swift5): fix compile error from Alamofire 5.10 --- .openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 | 2 +- Sources/AlamofireImplementations.swift | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 b/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 index ccf8a5a..4621ff6 100644 --- a/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 +++ b/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 @@ -1 +1 @@ -9d05425d4fb2c3a73804ed5a27232eda6751260b0947f6b4c736cc96df300103 \ No newline at end of file +6f374764cf476ad001123c84953d1980aaf6bc352573020d111594ab74058bf6 \ No newline at end of file diff --git a/Sources/AlamofireImplementations.swift b/Sources/AlamofireImplementations.swift index 1dd6726..6315e5d 100644 --- a/Sources/AlamofireImplementations.swift +++ b/Sources/AlamofireImplementations.swift @@ -413,6 +413,8 @@ extension JSONDataEncoding: ParameterEncoding { public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { 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]?) } }