Swiftpack.co - apple/swift-openapi-generator as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by apple.
apple/swift-openapi-generator 0.2.2
Generate Swift client and server code from an OpenAPI document.
⭐️ 641
🕓 5 days ago
iOS macOS watchOS tvOS linux macOS iOS
.package(url: "https://github.com/apple/swift-openapi-generator.git", from: "0.2.2")

Swift OpenAPI Generator

Generate Swift client and server code from an OpenAPI document.

Overview

OpenAPI is an open specification for documenting HTTP APIs.

Swift OpenAPI Generator is a Swift package plugin that can generate the ceremony code required to make API calls, or implement API servers.

Repository organization

The Swift OpenAPI Generator project is split across multiple repositories to enable extensibility and minimize dependencies in your project.

swift-openapi-generator (source, docs) provides the plugin.

swift-openapi-runtime (source, docs) provides a library with common types and abstractions used by the generated code.

See the generator in action in Meet Swift OpenAPI Generator from WWDC23.

Choose one of the transports listed below, or create your own by adopting the ClientTransport or ServerTransport protocol:

Repository Type Description
apple/swift-openapi-urlsession Client Uses URLSession from Foundation.
swift-server/swift-openapi-async-http-client Client Uses HTTPClient from AsyncHTTPClient.
swift-server/swift-openapi-vapor Server Uses Vapor.
swift-server/swift-openapi-hummingbird Server Uses Hummingbird.

Requirements and supported features

Generator versions Supported OpenAPI versions Minimum Swift version
0.1.0 ... 0.1.11 3.0 5.8
0.1.12 ... main 3.0, 3.1 5.8

Supported platforms and minimum versions

The generator is used during development and is supported on macOS and Linux.

The generated code, runtime library, and transports are supported on more platforms, listed below.

Component macOS Linux iOS tvOS watchOS
Generator plugin and CLI ✅ 10.15+
Generated code, runtime, transports ✅ 10.15+ ✅ 13+ ✅ 13+ ✅ 6+

Documentation

To get started, check out the full documentation, which contains step-by-step tutorials!

GitHub

link
Stars: 642
Last commit: 2 days ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Swift OpenAPI Generator 0.2.2
5 days ago

What's Changed

SemVer Patch

Other Changes

New Contributors

Full Changelog: https://github.com/apple/swift-openapi-generator/compare/0.2.1...0.2.2

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics