Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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).