Skip to content

Add support for streaming on recent Darwin platforms #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,21 @@ This product contains derivations of various scripts from SwiftNIO.
* https://www.apache.org/licenses/LICENSE-2.0
* HOMEPAGE:
* https://github.com/apple/swift-nio

-------------------------------------------------------------------------------

This product contains AsyncSequence implementations from Swift Async Algorithms.

* LICENSE (Apache License 2.0):
* https://github.com/apple/swift-async-algorithms/blob/main/LICENSE.txt
* HOMEPAGE:
* https://github.com/apple/swift-async-algorithms

-------------------------------------------------------------------------------

This product contains AsyncSequence implementations from Swift.

* LICENSE (Apache License 2.0):
* https://github.com/apple/swift/blob/main/LICENSE.txt
* HOMEPAGE:
* https://github.com/apple/swift
20 changes: 19 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@ swiftSettings.append(
// Require `any` for existential types.
.enableUpcomingFeature("ExistentialAny")
)

// Strict concurrency is enabled in CI; use this environment variable to enable it locally.
if ProcessInfo.processInfo.environment["SWIFT_OPENAPI_STRICT_CONCURRENCY"].flatMap(Bool.init) ?? false {
swiftSettings.append(contentsOf: [
.define("SWIFT_OPENAPI_STRICT_CONCURRENCY"), .enableExperimentalFeature("StrictConcurrency"),
])
}
#endif


let package = Package(
name: "swift-openapi-urlsession",
platforms: [
Expand All @@ -40,19 +48,29 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/apple/swift-openapi-runtime", .upToNextMinor(from: "0.3.0")),
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-collections", from: "1.0.0"),
],
targets: [
.target(
name: "OpenAPIURLSession",
dependencies: [
.product(name: "DequeModule", package: "swift-collections"),
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
],
swiftSettings: swiftSettings
),
.testTarget(
name: "OpenAPIURLSessionTests",
dependencies: ["OpenAPIURLSession"],
dependencies: [
"OpenAPIURLSession",
.product(name: "NIOTestUtils", package: "swift-nio"),
],
swiftSettings: swiftSettings
),
]
)

// Test-only dependencies.
package.dependencies += [
.package(url: "https://github.com/apple/swift-nio", from: "2.62.0")
]
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ A client transport that uses the [URLSession](https://developer.apple.com/docume
Use the transport with client code generated by [Swift OpenAPI Generator](https://github.com/apple/swift-openapi-generator).

## Supported platforms and minimum versions
| macOS | Linux | iOS | tvOS | watchOS |
| :-: | :-: | :-: | :-: | :-: |
| ✅ 10.15+ | ✅ | ✅ 13+ | ✅ 13+ | ✅ 6+ |

| macOS | Linux | iOS | tvOS | watchOS |
| :-: | :-: | :-: | :-: | :-: |
| ✅ 10.15+ | ✅ | ✅ 13+ | ✅ 13+ | ✅ 6+ |

Note: Streaming support only available on macOS 12+, iOS 15+, tvOS 15+, and
watchOS 8+.For streaming support on Linux, please use the [AsyncHTTPClient
Transport](https://github.com/swift-server/swift-openapi-async-http-client)

## Usage

Expand Down
Loading