apple/swift-openapi-generator

Generate Swift client and server code from an OpenAPI document.

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 31 minutes ago
Added to GitGenius on June 21st, 2025
Created on April 20th, 2023
Open Issues & Pull Requests: 140 (+0)
Number of forks: 177
Total Stargazers: 1,959 (+0)
Total Subscribers: 112 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 3.6 hours
Mean response time: 61.2 days
90th percentile: 292.4 days
Tracked items: 226

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 95% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Work labelled "kind/support" is answered fastest, typically in about 2 hours, while "area/openapi" waits about 9 months. Only 4% of issues opened in the past year have been closed. Three people close 57% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 105
New in 7 days: 2
Closed in 7 days: 2
Avg open age: 449 days
Stale 30+ days: 97
Stale 90+ days: 91

Recent activity

Opened in 7 days: 2
Closed in 7 days: 2
Comments in 7 days: 7
Events in 7 days: 21

Top labels

  • status/triage (142)
  • kind/support (81)
  • kind/bug (79)
  • area/generator (62)
  • kind/feature (51)
  • kind/enhancement (50)
  • size/S (38)
  • status/needs-design (26)

Detailed Description

Swift OpenAPI Generator is an Apple-maintained Swift package plugin that automates the generation of Swift client and server code from OpenAPI documents. The tool reads OpenAPI specifications written in YAML or JSON and generates the necessary ceremony code to make API calls or implement API servers, eliminating the need to manually write boilerplate HTTP handling code. Code generation occurs at build-time, ensuring the generated code remains synchronized with the OpenAPI document without requiring commits to the source repository.

The generator supports OpenAPI Specification versions 3.0 and 3.1, with preliminary support for version 3.2. It provides comprehensive support for multiple content types including JSON, multipart, URL-encoded form, base64, plain text, and raw bytes, all represented as type-safe value types with strongly-typed properties. A notable feature is support for streaming request and response bodies, enabling use cases such as JSON event streams and handling large payloads without buffering them entirely in memory. The architecture employs client, server, and middleware abstractions that decouple generated code from specific HTTP client libraries and web frameworks, providing flexibility in implementation choices.

The project is structured across multiple repositories to enable extensibility and minimize dependencies. The core generator repository contains the Swift package plugin and command-line interface. The ecosystem includes a runtime library used by generated code, transport implementations for various HTTP clients and frameworks such as URLSession, AsyncHTTPClient, OkHttp, Vapor, Hummingbird, and AWS Lambda, allowing developers to choose their preferred networking and server solutions.

The repository shares contributors with microsoft/vscode, swiftlang/swift, and microsoft/typescript, indicating cross-ecosystem involvement.

Platform support is extensive for generated code and runtime components, covering macOS 10.15 and later, Linux, Windows, iOS 13 and later, tvOS 13 and later, watchOS 6 and later, visionOS 1 and later, and Android. The generator plugin itself runs on macOS, Linux, and Windows during development. The project provides comprehensive documentation including step-by-step tutorials and example projects demonstrating integration with other ecosystem packages. A WWDC23 presentation titled "Meet Swift OpenAPI Generator" offers video-based introduction to the tool's capabilities and usage patterns.