Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-07T16:21:12.000Z (2 months ago)
- Last Synced: 2024-09-29T21:41:22.403Z (about 2 months ago)
- Topics: openapi, swift, transport, urlsession
- Language: Swift
- Homepage: https://swiftpackageindex.com/apple/swift-openapi-urlsession/documentation
- Size: 144 KB
- Stars: 159
- Watchers: 97
- Forks: 28
- Open Issues: 3
-
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://img.shields.io/badge/docc-read_documentation-blue)](https://swiftpackageindex.com/apple/swift-openapi-urlsession/documentation)
[![](https://img.shields.io/github/v/release/apple/swift-openapi-urlsession)](https://github.com/apple/swift-openapi-urlsession/releases)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fapple%2Fswift-openapi-urlsession%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/apple/swift-openapi-urlsession)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fapple%2Fswift-openapi-urlsession%2Fbadge%3Ftype%3Dplatforms)](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 | 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).