mattpolzin / JSONAPI

Swift Codable JSON:API framework
MIT License
75 stars 19 forks source link

Poly version issue loading JSONAPI via CocoaPods #97

Closed scotsimon closed 2 years ago

scotsimon commented 2 years ago

I was attempting to install JSONAPI via CocoaPods this morning and I've run into an issue.

JSONAPI specifies version 2.4.0 for POLY, however the version available is 2.5.3. This results in an error during the install process.

Can you update the Poly version requirement in JSONAPI to match the available version of Poly?

mattpolzin commented 2 years ago

I suppose I can bump the version requirement and release. Is that really the way that CocoaPods works, though? I would hope you could load in a prior version of Poly without issue.

scotsimon commented 2 years ago

I am far from an expert with CocoaPods. However, when using your recommended configuration...

pod 'Poly', :git => 'https://github.com/mattpolzin/Poly.git' pod 'MP-JSONAPI', :git => 'https://github.com/mattpolzin/JSONAPI.git'

... the installer provided the following error:

[!] CocoaPods could not find compatible versions for pod "Poly": In Podfile: MP-JSONAPI (from https://github.com/mattpolzin/JSONAPI.git) was resolved to 5.0.0, which depends on Poly (~> 2.4.0)

Poly (from `https://github.com/mattpolzin/Poly.git`)
mattpolzin commented 2 years ago

I'll release an update that relaxes that to allow anything up to the next major version of Poly in the podspec.

Meanwhile, based on the quick reading I've done, you should be able to specify that you want the Poly pod at my GitHub repo and specify a particular version you want somehow, I just can't say how because I've never used CocoaPods myself.

mattpolzin commented 2 years ago

This is the idea I would think:

pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :tag => '3.1.1'

So you could specify the Poly repo and the tag for version 2.4.0

[EDIT] So verbatim, I would expect this to work until I release an update:

pod 'Poly', :git => 'https://github.com/mattpolzin/Poly.git', :tag => '2.4.0'
scotsimon commented 2 years ago

Fantastic. I'll take a look at the workaround. I have plenty of time to spend getting my arms around your framework - looks great though. Thanks for everything!

mattpolzin commented 2 years ago

I've released JSONAPI verion 5.0.2 with relaxed Poly requirements that should work with the latest releases of Poly. I'll close this issue for now, but please reopen it if you are still experiencing dependency problems.