Skip to content

Upgrade Swift OpenAPI Generator To 1.13.0 - #38

Merged
dinoconstantinou87 merged 2 commits into
mainfrom
chore/upgrade-openapi-generator
Sep 23, 2026
Merged

dinoconstantinou87 merged 2 commits into
mainfrom
chore/upgrade-openapi-generator

Conversation

@dinoconstantinou87

Copy link
Copy Markdown
Owner

Summary

Moves swift-openapi-generator from 1.10.2 to 1.13.0 and makes make generate notice when the pinned version changes.

Generator upgrade

Before After Why
Generator (Makefile) 1.10.2 1.13.0 Four minor versions behind
swift-openapi-runtime floor (Package.swift) 1.8.2 1.11.0 The generator's own minimum since 1.12.0
Generator cache keys (ci.yml, linux.yml, macos.yml) 1.10.2 1.13.0 So CI builds the new generator

Package.resolved doesn't change. It already had runtime 1.12.1 from #35.

OpenAPIKit v6, which arrived in 1.12.1 with stricter validation, accepts the spec with no warnings or errors. Apart from two changes, the generated code is the same as 1.10.2's: every import is now public (1.13.0, following accessModifier), and Encoder, Decoder and Error are written as Swift.Encoder and so on (1.11.0).

Why not 1.13.1: its namespace file splitting is always on. With accessModifier: public, it produces 24 UnusedImportAccess warnings from imports that the small split files never use. The issue is tracked upstream in apple/swift-openapi-generator#946, and the fix, apple/swift-openapi-generator#947, is unreleased. Apart from the splitting, 1.13.1 only adds a clearer error for duplicate schema names. Worth bumping again once #947 ships.

Makefile: re-clone on a version change

Before this, the clone target had no prerequisites, so changing SWIFT_OPENAPI_GENERATOR_GIT_TAG left any existing clone in place and make generate kept running the old generator without saying so. The clone is now keyed on a .cloned-<tag> stamp file inside it. If the stamp is missing, make generate deletes the clone and Sources/FreeAgentAPI/Generated, then re-clones and rebuilds. An existing clone without a stamp is refreshed once.

Generated/ is cleared too because the generator never deletes files it no longer produces. Switching from 1.13.1 back to 1.13.0 left 1.13.1's split files behind, and the build failed with "invalid redeclaration of 'Components'".

Testing

  • macOS: 92 API and 25 CLI unit tests pass, make format and make lint clean. Built with 1.13.0 and 1.13.1 and counted warnings from generated code: none with 1.13.0, 24 with 1.13.1.
  • make generate checked for real, not just dry runs: an existing unstamped clone refreshes once, an unchanged tag deletes and rebuilds nothing, and 1.13.0 -> 1.13.1 -> 1.13.0 leaves the right generator and only its own files each time, and the build passes.
  • Integration suites not run. They were skipped locally, and CI's Integration Tests job skips them because openapi/ is unchanged. The generated code differs only in import modifiers and name qualification, so the requests and responses on the wire can't change.

🤖 Generated with Claude Code

dinoconstantinou87 and others added 2 commits September 23, 2026 19:47
Moves the generator from 1.10.2 to 1.13.0 and raises the
swift-openapi-runtime floor from 1.8.2 to 1.11.0, the minimum the
generator has required since 1.12.0. Package.resolved already has
1.12.1, so nothing re-resolves. The CI cache keys carry the new
version.

OpenAPIKit v6 accepts the spec without diagnostics, and the generated
code only gains public imports and Swift-qualified stdlib types.

1.13.1 is skipped: its namespace file splitting emits unused public
import warnings (apple/swift-openapi-generator#946, fix in #947).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The clone target had no prerequisites, so bumping
SWIFT_OPENAPI_GENERATOR_GIT_TAG kept running the old generator from an
existing clone. The clone is now keyed on a .cloned-<tag> stamp. A
missing stamp deletes the clone and the generated sources, then
re-clones and rebuilds.

The generated sources go too because the generator never deletes files
it no longer emits. Switching from 1.13.1 back to 1.13.0 left its split
files behind and failed the build with a redeclaration of Components.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@dinoconstantinou87
dinoconstantinou87 merged commit 09499aa into main Sep 23, 2026
4 checks passed
@dinoconstantinou87
dinoconstantinou87 deleted the chore/upgrade-openapi-generator branch September 23, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant