Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit caa5303

Browse files
Prep for 1.0 alpha, adapted to runtime changes in main (#25)
### Motivation On main, the HTTPBody length type changed from Int to Int64. ### Modifications Adapted the transport with this change. ### Result Repo builds again when using the latest runtime. ### Test Plan Adapted tests.
1 parent 701d752 commit caa5303

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ let package = Package(
4040
dependencies: [
4141
.package(url: "https://github.com/apple/swift-nio", from: "2.58.0"),
4242
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.19.0"),
43-
.package(url: "https://github.com/apple/swift-openapi-runtime", .upToNextMinor(from: "0.3.0")),
43+
.package(url: "https://github.com/apple/swift-openapi-runtime", branch: "main"),
4444
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
4545
],
4646
targets: [

‎Sources/OpenAPIAsyncHTTPClient/AsyncHTTPClientTransport.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public struct AsyncHTTPClientTransport: ClientTransport {
181181
let length: HTTPClientRequest.Body.Length
182182
switch body.length {
183183
case .unknown: length = .unknown
184-
case .known(let count): length = .known(count)
184+
case .known(let count): length = .known(Int(count))
185185
}
186186
clientRequest.body = .stream(body.map { .init(bytes: 0ドル) }, length: length)
187187
}
@@ -197,7 +197,7 @@ public struct AsyncHTTPClientTransport: ClientTransport {
197197
for header in httpResponse.headers { headerFields[.init(header.name)!] = header.value }
198198

199199
let length: HTTPBody.Length
200-
if let lengthHeaderString = headerFields[.contentLength], let lengthHeader = Int(lengthHeaderString) {
200+
if let lengthHeaderString = headerFields[.contentLength], let lengthHeader = Int64(lengthHeaderString) {
201201
length = .known(lengthHeader)
202202
} else {
203203
length = .unknown

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /