This library extends swift-api-client to make it a more universal tool.
The library offers a straightforward approach to handling WebSockets, utilizing the Starscream library.
let channel: WebSocketChannel<Item> = try client.call(.webSocket, as: .decodable)
for try await item in channel {
...
}Integrates the swift-json library for easy JSON API interactions.
let json = try client.body(bodyJSON).call(.http, as: .json)Create a Package.swift file.
// swift-tools-version:5.7
import PackageDescription
let package = Package(
name: "SomeProject",
dependencies: [
.package(url: "https://github.com/dankinsoid/swift-api-client-addons.git", from: "0.15.0")
],
targets: [
.target(
name: "SomeProject",
dependencies: [
.product(name: "SwiftAPIClientAddons", package: "swift-api-client-addons"),
]
)
]
)$ swift builddankinsoid, voidilov@gmail.com
swift-api-client-addons is available under the MIT license. See the LICENSE file for more info.
We welcome contributions to swift-api-client-addons! Please read our contributing guidelines to get started.