https://github.com/apple/swift-openapi-urlsession
URLSession transport for Swift OpenAPI Generator.
https://github.com/apple/swift-openapi-urlsession
openapi swift transport urlsession
Last synced: 3 months ago
JSON representation
URLSession transport for Swift OpenAPI Generator.
- Host: GitHub
- URL: https://github.com/apple/swift-openapi-urlsession
- Owner: apple
- License: apache-2.0
- Created: 2023-04-20T16:53:01.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-02T07:31:57.000Z (3 months ago)
- Last Synced: 2025-04-03T23:09:12.545Z (3 months ago)
- Topics: openapi, swift, transport, urlsession
- Language: Swift
- Homepage: https://swiftpackageindex.com/apple/swift-openapi-urlsession/documentation
- Size: 161 KB
- Stars: 173
- Watchers: 102
- Forks: 40
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# URLSession Transport for Swift OpenAPI Generator
[](https://swiftpackageindex.com/apple/swift-openapi-urlsession/documentation)
[](https://github.com/apple/swift-openapi-urlsession/releases)
[](https://swiftpackageindex.com/apple/swift-openapi-urlsession)
[](https://swiftpackageindex.com/apple/swift-openapi-urlsession)A client transport that uses the [URLSession](https://developer.apple.com/documentation/foundation/urlsession) type from the [Foundation](https://developer.apple.com/documentation/foundation) framework to perform HTTP operations.
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, Windows | iOS | tvOS | watchOS | visionOS |
| :-: | :-: | :-: | :-: | :-: | :-: |
| ✅ 10.15+ | ✅ | ✅ 13+ | ✅ 13+ | ✅ 6+ | ✅ 1+ |Note: Streaming support only available on macOS 12+, iOS 15+, tvOS 15+, watchOS 8+, and visionOS 1+. For streaming support on Linux, please use the [AsyncHTTPClient Transport](https://github.com/swift-server/swift-openapi-async-http-client)
## Usage
Add the package dependency in your `Package.swift`:
```swift
.package(url: "https://github.com/apple/swift-openapi-urlsession", from: "1.0.0"),
```Next, in your target, add `OpenAPIURLSession` to your dependencies:
```swift
.target(name: "MyTarget", dependencies: [
.product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"),
]),
```Then, to get started, check out `URLSessionTransport`.
## Documentation
To learn more, check out the full [documentation](https://swiftpackageindex.com/apple/swift-openapi-urlsession/documentation).