mattpolzin / OpenAPIKit

Codable Swift OpenAPI implementation.
MIT License
280 stars 35 forks source link

Dependency conflict with swiftlint when adding SwiftLintPlugin #259

Closed knellr closed 1 year ago

knellr commented 1 year ago

We're moving our local modules from packages to Swift Package Manager, and in the process adopting the new SwiftLint plugin.

Unfortunately, SwiftLint has a dependency on Yams 5.0.1 and above (https://github.com/realm/SwiftLint/blob/main/Package.swift#L32) and OpenAPIKit is on version 4.

We're currently using 3.0 alpha 3 in order to parse optional references (https://github.com/mattpolzin/OpenAPIKit/issues/228). I've temporarily forked OpenAPIKit and updated yams in the following commit:

https://github.com/knellr/OpenAPIKit/commit/5954f3cd55dca1b6c1a086f65e2c73c068068834

Is this the right fix? Would you want to support a range of versions instead? It looks like the only breaking change with Yams 5.0 is requiring Swift 5.4.

mattpolzin commented 1 year ago

This dependency, which OpenAPIKit only even needs for testing purposes, has always been a bummer when it comes to conflicts with downstream users’ package manifests.

I like the idea of supporting a range. Perhaps "4.0.0"..<"6.0.0" for the time being.

This feels like a good patch release for both versions 2 and 3 of OpenAPIKit, actually. Unless I am missing something like a lack of support for that range syntax with the version of package manager the current manifest specifies.