-
Notifications
You must be signed in to change notification settings - Fork 149
Open
Labels
kind/supportAdopter support requests.Adopter support requests.status/triageCollecting information required to triage the issue.Collecting information required to triage the issue.
Description
Question
Since Xcode 26 beta 5 i cannot comply with the ClientMiddleware protocol of swift-openapi-runtime. The error that I got is Candidate has non-matching type '(HTTPRequest, HTTPBody?, URL, String, nonisolated(nonsending) @Sendable (HTTPRequest, HTTPBody?, URL) async throws -> (HTTPResponse, HTTPBody?)) async throws -> (HTTPResponse, HTTPBody?)' for a structure that seems (and was) to be well "made":
public struct ApiKeyMiddleware: ClientMiddleware {
//The API key to login
private let apiKey: String
public init(apiKey: String) { self.apiKey = apiKey }
public func intercept(
_ request: HTTPRequest,
body: HTTPBody?,
baseURL: URL,
operationID: String,
next: @Sendable (HTTPRequest, HTTPBody?, URL) async throws -> (
HTTPTypes.HTTPResponse, OpenAPIRuntime.HTTPBody?
)
) async throws -> (HTTPTypes.HTTPResponse, OpenAPIRuntime.HTTPBody?) {
var request = request
request.headerFields[.init("x-goog-api-key")!] = self.apiKey
return try await next(request, body, baseURL)
}
}Is this an Xcode/Swift bug or is there something that I'm missing?
Thanks
Metadata
Metadata
Assignees
Labels
kind/supportAdopter support requests.Adopter support requests.status/triageCollecting information required to triage the issue.Collecting information required to triage the issue.