We’re happy to announce that Swift OpenAPI Generator just reached the 1.0.0 milestone!
Since it went open source in May 2023 with version 0.1.0, Swift OpenAPI Generator merged over 300 pull requests, released 25 updates, and introduced support for several major new features.
It wouldn’t be possible without over 25 contributors who filed great issues, dove into the code and opened pull requests, provided feedback on proposals, and helped prioritize which issues need to get addressed first based on real-world usage.
TL;DR of Swift OpenAPI Generator
- Works with OpenAPI Specification versions 3.0 and 3.1.
- Streaming request and response bodies enabling use cases such as JSON event streams, and large payloads without buffering.
- Support for JSON, multipart, URL-encoded form, base64, plain text, and raw bytes, represented as value types with type-safe properties.
- Client, server, and middleware abstractions, decoupling the generated code from the HTTP client library and web framework.
Highlights since 1.0.0-alpha.1
- Added 20 real-world example projects, to help you get started or get inspired by some of the advanced features of Swift OpenAPI Generator.
- Refreshed the README, tutorials, and our DocC documentation.
Migrating from 1.0.0-alpha.1 to 1.0.0
The 1.0.0 tags are now ready on the generator and runtime repositories, as well as on the URLSession, AsyncHTTPClient, Vapor, and Hummingbird transports.
This makes upgrading to 1.0.0 as easy as changing all of your Swift OpenAPI package dependencies from:
.package(url: "https://github.com/apple/swift-openapi-...", exact: "1.0.0-alpha.1"),
to
.package(url: "https://github.com/apple/swift-openapi-...", from: "1.0.0"),
The only notable change between 1.0.0-alpha.1 and 1.0.0 was the switch to use internal
as the default access modifier for generated code, instead of public
or package
.
If you only use the generated code from within the same module, no action is needed.
If you need your generated code to be visible from outside your module, add accessModifier: package
(or public
) to the generator config file, or add --access-modifier package
(or public
) to the command-line invocation.
Migrating from previous versions
What’s next
The API of the runtime library, transports, and the generator itself is now considered stable and will not undergo breaking changes in future 1.x versions.
We’re already working on version 1.1, which will add convenience parsers and serializers for commonly used event stream formats, such as JSON Lines, JSON Sequence, and Server-sent Events.
Thanks again to all our contributors and if you’d like to get involved, check out Swift OpenAPI Generator on GitHub.
– @Honza_Dvorsky and @beaumont