Skip to content

Commit c138732

Browse files
authored
Add a missing protocol conformance to ClientTransport (#4)
Add a missing protocol conformance to ClientTransport ### Motivation We lost URLSessionTransport's conformance to ClientTransport along the way somewhere. But that's kind of its main job :) ### Modifications Re-add the conformance. ### Result Now the transport can be used as a ClientTransport again. ### Test Plan Explicitly cast the test transport to be a ClientTransport, rather than using the concrete type. Reviewed by: simonjbeaumont Builds: ✔︎ pull request validation (5.8) - Build finished. ✔︎ pull request validation (5.9) - Build finished. ✔︎ pull request validation (nightly) - Build finished. ✔︎ pull request validation (soundness) - Build finished. #4
1 parent d42f383 commit c138732

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/OpenAPIURLSession/URLSessionTransport.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ import Foundation
5252
/// The ``URLSessionTransport/Configuration-swift.struct`` type allows you to
5353
/// provide a custom URLSession and tweak behaviors such as the default
5454
/// timeouts, authentication challenges, and more.
55-
public struct URLSessionTransport {
55+
public struct URLSessionTransport: ClientTransport {
5656

5757
/// A set of configuration values for the URLSession transport.
5858
public struct Configuration: Sendable {

Tests/OpenAPIURLSessionTests/URLSessionTransportTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class URLSessionTransportTests: XCTestCase {
5959
body: Data("👋".utf8)
6060
)
6161
)
62-
let transport = URLSessionTransport(
62+
let transport: ClientTransport = URLSessionTransport(
6363
configuration: .init(session: MockURLProtocol.mockURLSession)
6464
)
6565
let request = OpenAPIRuntime.Request(

0 commit comments

Comments
 (0)