You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When making a call to the Strava API via Alamofire, the Router parameter only accepts Int values for the gear.id
However, the gear defined in the Strava API documentation is listed as a String.
Thoughts?
The text was updated successfully, but these errors were encountered:
In the Strava API there are 2 ways of getting gear:
1: Each 'detailed activity' contains a Gear object - this should work (although I've not tried it yet)
2: Router call athleteActivities returns an array of activities each containing a gear_id, which can then then be used in the Strava API (Router call gear) to get the Gear object.
Method 2 does not work in the library for 2 reasons:
a) gear_id is not decoded onto the Activity class. This is a simple fix to add public let gearID: String? to the class, and gearID = json["gear_id"].string to the init
b) As Kurtis pointed out, Router expects ID to be an Int, but gear_id is a String. As id is not used in any calculation but simply passed around I can't see why it can't be made into a String.
In Router.swift I just changed public typealias Id = Int to public typealias Id = String and it works (at least for the calls in my program). I also added support for gear_id as in my previous reply. I'll package these into a pull request
When making a call to the Strava API via Alamofire, the Router parameter only accepts Int values for the gear.id
However, the gear defined in the Strava API documentation is listed as a String.
Thoughts?
The text was updated successfully, but these errors were encountered: