mpclarkson / StravaSwift

A Swift wrapper for the Strava API v3
MIT License
104 stars 45 forks source link

Class Effort has incorrect return type for Activity #17

Closed FleetPhil closed 5 years ago

FleetPhil commented 5 years ago

Class Effort is written expecting that Strava returns an Activity property in a DetailedSegmentEffort response. In fact the activity returned is an instance of MetaActivity that contains only an activity ID. This error means that the result returned in StravaSwift by an Effort class does not contain a reference to a valid activity What is required is to add a class for MetaActivity with the correct data

lludo commented 5 years ago

Oh, good catch! Looks like this is a recent change in the API. Any chances you could submit a pull request to update this?

FleetPhil commented 5 years ago

I have made a number of fixes - also the library in its current form did not fully support the current OAuth token refresh mechanism. I’m not sure the author is monitoring the library so I made a branch into my repository. I'll take a look later today and try and gather together the changes into a pull request

lludo commented 5 years ago

Perfect, thank you! I made a few updates to fix OAuth token API changes.

lludo commented 5 years ago

Fixed in #15

mpclarkson commented 5 years ago

Thanks @lludo for taking over managing this project.

FleetPhil commented 5 years ago

Thanks from me too Now all my changes have been merged I’ve rebased my project onto the master and archived my fork. Special thanks for sorting out the token refresh mechanism, as a relative newbie Swift hacker it would have taken me much longer to get it to that state! If I find any more issues I’ll fork and raise a pull request