From 8ea81832c40e98564d93535aa82860d5810dd122 Mon Sep 17 00:00:00 2001 From: ThibaultBee Date: Mon, 21 Oct 2024 08:47:47 +0000 Subject: [PATCH] fix(swift5): fix compile error from Alamofire 5.10 --- .github/workflows/build.yml | 18 ++---------------- .../oas_apivideo.yaml-defaut-cli.sha256 | 2 +- Sources/AlamofireImplementations.swift | 4 +++- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 65e710f..45dbaa9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,24 +28,10 @@ jobs: uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable - - name: Set Default Scheme - run: | - scheme_list=$(xcodebuild -list -json | tr -d "\n") - default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['workspace']['schemes'][0]") - echo $default | cat >default - echo Using default scheme: $default - name: Build Package with xcodebuild - env: - scheme: ${{ 'default' }} - run: | - if [ $scheme = default ]; then scheme=$(cat default); fi - xcodebuild -scheme $scheme -destination 'platform=iOS Simulator,name=iPhone 16' + run: xcodebuild -scheme ApiVideoClient -destination 'platform=iOS Simulator,name=iPhone 16' - name: Build Example - env: - scheme: ${{ 'default' }} - run: | - if [ $scheme = default ]; then scheme=$(cat default); fi - xcodebuild clean build -project Example/Example.xcodeproj -scheme $scheme -sdk iphoneos + run: xcodebuild clean build -project Example/Example.xcodeproj -scheme ApiVideoClient -sdk iphoneos cocoapods: name: Verify cocopods podspec 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 a064c91..59eed3f 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]?) } }