Trying to utilize the new OpenAPI Generator, but after following all of the steps exactly as stated in the video, I get the following errors:
- The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0
- The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0
- The package product 'SwiftFormat' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0
- The package product 'SwiftFormatConfiguration' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0
under both _OpenAPIGeneratorCore and swift-openapi-generator
I've seen other things online where people have had similar issues, but the fixes haven't been particularly relevant that I could tell.
This is likely because you're linking the generator target itself to the iOS app, which is not supported. See Step 7 of https://swiftpackageindex.com/apple/swift-openapi-generator/0.1.3/tutorials/swift-openapi-generator/clientxcode#Configuring-your-target-to-use-the-Swift-OpenAPI-Generator-plugin, which clarifies that the checkboxes to link the generator targets (_OpenAPIGeneratorCore
and swift-openapi-generator
) should not be linked directly, they're only meant to be used through the plugin.
Only the OpenAPIRuntime and any transport libraries are meant to be linked to your app.
Here is an issue tracking improving the errors when this happens: https://github.com/apple/swift-openapi-generator/pull/87
A way to fix it is: in Xcode, go to the Project Editor -> select your app target -> go to Build Phases -> expand Link Binary with Libraries, and remove _OpenAPIGeneratorCore
and swift-openapi-generator
. Then try to build again.