From aceaa423e8b00aa9f0d63c2b828e4ecb810b15ab Mon Sep 17 00:00:00 2001 From: dankinsoid <30962149+dankinsoid@users.noreply.github.com> Date: Tue, 23 Jul 2024 12:55:52 +0400 Subject: [PATCH] 1.32.0 --- Sources/SwiftAPIClient/Extensions/URLComponentBuilder.swift | 4 ++-- Sources/SwiftAPIClient/Modifiers/RequestModifiers.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/SwiftAPIClient/Extensions/URLComponentBuilder.swift b/Sources/SwiftAPIClient/Extensions/URLComponentBuilder.swift index b540070..2fe7424 100644 --- a/Sources/SwiftAPIClient/Extensions/URLComponentBuilder.swift +++ b/Sources/SwiftAPIClient/Extensions/URLComponentBuilder.swift @@ -71,7 +71,7 @@ public extension URLComponentBuilder { /// - percentEncoded: A Boolean to determine whether to percent encode the components. Default is `false`. /// - Returns: An instance with updated path. func path(_ components: any CustomStringConvertible..., percentEncoded: Bool = false) -> BuildResult { - path(components, percentEncoded: percentEncoded) + path(components.map(\.description), percentEncoded: percentEncoded) } /// Appends an array of path components to the URL. @@ -79,7 +79,7 @@ public extension URLComponentBuilder { /// - components: An array of components that conform to `CustomStringConvertible`. /// - percentEncoded: A Boolean to determine whether to percent encode the components. Default is `false`. /// - Returns: An instance with updated path. - func path(_ components: [any CustomStringConvertible], percentEncoded: Bool = false) -> BuildResult { + func path(_ components: [T], percentEncoded: Bool = false) -> BuildResult { configureURLComponents { guard !components.isEmpty else { return } let items = components.flatMap { diff --git a/Sources/SwiftAPIClient/Modifiers/RequestModifiers.swift b/Sources/SwiftAPIClient/Modifiers/RequestModifiers.swift index fc8e92d..2466b87 100644 --- a/Sources/SwiftAPIClient/Modifiers/RequestModifiers.swift +++ b/Sources/SwiftAPIClient/Modifiers/RequestModifiers.swift @@ -23,7 +23,7 @@ public extension RequestBuilder where Request == HTTPRequestComponents { /// - percentEncoded: A Boolean to determine whether to percent encode the components. Default is `false`. /// - Returns: An instance with updated path. func path(_ components: any CustomStringConvertible..., percentEncoded: Bool = false) -> Self { - path(components, percentEncoded: percentEncoded) + path(components.map(\.description), percentEncoded: percentEncoded) } /// Appends an array of path components to the URL of the request. @@ -31,7 +31,7 @@ public extension RequestBuilder where Request == HTTPRequestComponents { /// - components: An array of components that conform to `CustomStringConvertible`. /// - percentEncoded: A Boolean to determine whether to percent encode the components. Default is `false`. /// - Returns: An instance with updated path. - func path(_ components: [any CustomStringConvertible], percentEncoded: Bool = false) -> Self { + func path(_ components: [T], percentEncoded: Bool = false) -> Self { modifyRequest { $0 = $0.path(components, percentEncoded: percentEncoded) }