A Swift library and CLI tool for parsing OpenAPI/Swagger 3.0 specs and generating code from them.
SwagGen is a Swift-based toolset for parsing OpenAPI/Swagger 3.0 specifications and generating code from them. It consists of a library for programmatically loading and inspecting API specs and a command-line tool that uses templates to produce client libraries or other artifacts, helping automate API integration workflows.
Swift developers and teams who need to generate type-safe client code from OpenAPI specs, particularly those building iOS, macOS, or server-side Swift applications that consume RESTful APIs.
Developers choose SwagGen for its Swift-native implementation, flexible template system, and the bundled production-ready Swift client template that supports modern Swift features like Codable and customizable generation options.
OpenAPI/Swagger 3.0 Parser and Swift code generator
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Built entirely in Swift, it seamlessly fits into Swift development workflows, allowing programmatic spec parsing via the Swagger library and easy CLI usage with Swift Package Manager.
Uses Stencil templates that can generate code for any language, enabling full customization of output structure and behavior, as highlighted in the template config documentation.
Includes a bundled template for generating comprehensive Swift client libraries with modern features like Codable models, configurable options, and a generic networking stack, reducing initial setup time.
Offers detailed command-line flags and template options to control naming, model inheritance, and output cleaning, as shown in the generate command help and options table.
The README explicitly states the project is no longer under development, meaning no future updates, bug fixes, or official support, which poses risks for long-term use.
Only provides a ready-to-use template for Swift; generating code for other languages requires creating custom templates from scratch, increasing effort for multi-language teams.
Requires a Swift toolchain (Xcode 11+ or Swift on Linux) for installation and operation, which can be a barrier for teams not already invested in the Swift ecosystem.
Specifically targets OpenAPI/Swagger 3.0 specs, so it lacks compatibility with the newer OpenAPI 3.1 standard, limiting its use with modern API specifications.