qmetrics.net

Swift OpenAPI Generator

Build-time OpenAPI client and server code generator for Swift

Swift OpenAPI Generator screenshot

A Swift package plugin generates Swift types and HTTP ceremony from OpenAPI documents, keeping generated code in sync at build time.

Overview

Swift OpenAPI Generator reads OpenAPI descriptions in YAML or JSON and emits Swift code for HTTP clients or server stubs. Generation runs as a Swift package plugin at build time so outputs stay aligned with the spec without committing generated sources.

It targets OpenAPI 3.0 and 3.1 with preliminary 3.2 support. Features include streaming bodies, typed encodings for JSON, multipart, forms, and raw bytes, and abstractions that separate generated code from the HTTP client or web framework via ClientTransport and ServerTransport.

Client code exposes one method per operation and works with any library that implements ClientTransport, such as URLSession or AsyncHTTPClient. Servers implement the generated APIProtocol and register handlers through a ServerTransport compatible with Vapor, Hummingbird, or AWS Lambda adapters in the ecosystem.

The generator plugin and CLI run on macOS, Linux, and Windows during development; generated runtime code targets additional Apple and Android platforms. Configuration uses an openapi-generator-config.yaml file beside the spec.

Key features

  • OpenAPI 3.0, 3.1, and preliminary 3.2
  • Client and server stub generation
  • Build-time Swift package plugin
  • Streaming request and response bodies
  • ClientTransport and ServerTransport abstractions
  • JSON, multipart, and form payload types
  • Separate runtime and transport packages
  • YAML generator configuration file

Use cases

  • Typed Swift API clients from OpenAPI
  • Server handlers matching a published spec
  • Spec-driven HTTP services in Swift
  • Integrating OpenAPI with Vapor or URLSession

Tags

Similar software

axios

Promise-based HTTP client for browser and Node.js

Axios is a promise-based HTTP client for JavaScript environments in the browser and Node.js. It supports common request methods, configurable defaults, and interceptors for request and response handling.

★ 109.5k⟳ 2 days agoMIT

FastAPI

Python web framework for building APIs with type hints

FastAPI is a Python web framework for building APIs using standard type hints. It builds on Starlette and Pydantic and generates interactive OpenAPI documentation for the endpoints you define.

★ 105.1k⟳ 9 days agoMIT

OmniRoute

OpenAI-compatible AI gateway with provider routing

OmniRoute exposes one endpoint that routes chat requests across many LLM providers with quota-aware fallback and compression.

★ 90.7k⟳ todayMIT

Hoppscotch

Web, desktop and CLI API development ecosystem

Hoppscotch lets developers send HTTP, WebSocket, GraphQL, and related API requests from a lightweight client. Collections, environments, teams, and sync help organize testing across devices.

★ 81k⟳ 5 days agoMIT
Open Source Alternative to:Postman

NestJS

Progressive TypeScript framework for Node.js backends

Nest organizes Node server apps with modules, dependency injection, and first-party packages for auth, data, queues, and observability.

★ 77.2k⟳ todayMIT

JSON Server

Zero-code mock REST API from JSON data files

JSON Server turns a JSON or JSON5 database file into a REST API for local prototyping. It supports filtering, sorting, pagination, embedding relations, and static assets.

★ 75.7k⟳ 8 months agoMIT