Repository navigation
Upgrade Swift OpenAPI Generator To 1.13.0 - #38
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves swift-openapi-generator from 1.10.2 to 1.13.0 and makes
make generatenotice when the pinned version changes.Generator upgrade
Makefile)Package.swift)ci.yml,linux.yml,macos.yml)1.10.21.13.0Package.resolveddoesn'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, followingaccessModifier), andEncoder,DecoderandErrorare written asSwift.Encoderand so on (1.11.0).Why not 1.13.1: its namespace file splitting is always on. With
accessModifier: public, it produces 24UnusedImportAccesswarnings 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_TAGleft any existing clone in place andmake generatekept 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 generatedeletes the clone andSources/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
make formatandmake lintclean. 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 generatechecked 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.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