This repository demonstrates how different SDK generator tools produce Swift SDKs when given the same OpenAPI specification.
The goal is to provide Swift developers with an easy, side-by-side comparison of SDK output quality, style, and ergonomics.
We generate Swift SDKs using the following tools:
- Apple’s Swift OpenAPI Generator
- Fern’s Swift OpenAPI Generator
All SDKs in this repository are generated from the Travel Train API specification, provided by our friends at Bump.sh.
Using a single consistent spec ensures the comparisons highlight generator differences rather than spec design.
- Highlight differences in code style, dependencies, and developer experience.
- Provide an apples-to-apples comparison by using the same API specification as input.
- Help Swift developers and API platform teams evaluate which SDK generator best fits their needs.
Each directory contains a generated Swift SDK from one of the tools above.
Typical comparison points include:
- Client initialization and configuration (authentication, base URL setup)
- API method signatures and ergonomics (parameter handling, response types)
- External dependencies (runtime frameworks, package footprint)
- Generated code size and complexity (file count, maintainability)
- Error handling patterns (error types, throwing vs. Result types)
- Swift language feature usage (async/await, structured concurrency, modern Swift idioms)
- Type safety and nullability (optional handling, type-safe enums)
- Documentation and code comments (inline docs, usage examples)
- Browse the directories for each SDK generator.
- Review the generated code and note differences in:
- Readability and maintainability
- Use of Swift language features
- Package manager setup (e.g., Swift Package Manager compatibility)
If you’d like to add another SDK generator for comparison:
- Generate a Swift SDK using the same OpenAPI specification.
- Create a new directory named after the generator.
- Include a short
README.md
inside describing the tool and version used. - Open a pull request.
This repository is affiliated with Fern and not Apple or openapi-generator. It is intended as a neutral comparison resource for Swift developers.