Skip to content

Commit

Permalink
Merge pull request #4 from novr/feature/swift-openapi-runtime_1-1-0
Browse files Browse the repository at this point in the history
feat: update swift-openapi-runtime v1.1.0
  • Loading branch information
novr committed Dec 18, 2023
2 parents 91c2c69 + d0d7def commit 0716fd4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-openapi-runtime.git",
"state" : {
"revision" : "a51b3bd6f2151e9a6f792ca6937a7242c4758768",
"version" : "0.3.6"
"revision" : "fd101c320185313bbf9c5a45b827b17eda9ff18a",
"version" : "1.1.0"
}
}
],
Expand Down
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.8
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -18,7 +18,7 @@ let package = Package(
targets: ["OpenAPICompute"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-openapi-runtime.git", from: "0.3.6"),
.package(url: "https://github.com/apple/swift-openapi-runtime.git", from: "1.1.0"),
.package(url: "https://github.com/swift-cloud/Compute", from: "2.18.0"),
],
targets: [
Expand All @@ -27,7 +27,7 @@ let package = Package(
.target(
name: "OpenAPICompute",
dependencies: [
.product(name: "Compute", package: "Compute"),
"Compute",
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
]),
.testTarget(
Expand Down
4 changes: 2 additions & 2 deletions Sources/OpenAPICompute/ComputeTransport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ extension Compute.Router {
}
switch body.length {
case let .known(length):
try await response.send(Data(collecting: body, upTo: length))
try await response.send(Data(collecting: body, upTo: Int(length)))
case .unknown:
try await response.send(Data(collecting: body, upTo: .max))
}
Expand Down Expand Up @@ -124,7 +124,7 @@ extension HTTPTypes.HTTPRequest {

extension OpenAPIRuntime.HTTPBody {
convenience init(_ computeRequest: Compute.IncomingRequest) async throws {
let contentLength = computeRequest.headers.entries().first { $0.key == "content-length"}.map { Int($0.value) }
let contentLength = computeRequest.headers.entries().first { $0.key == "content-length"}.map { Int64($0.value) }
await self.init(
try computeRequest.body.data(),
length: contentLength?.map { .known($0) } ?? .unknown,
Expand Down

0 comments on commit 0716fd4

Please sign in to comment.