-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change ID from Int to String to support gear_id #30
Open
FleetPhil
wants to merge
10
commits into
mpclarkson:master
Choose a base branch
from
FleetPhil:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ID for Strava `gear` (aka 'equipment') is a String, not Int. Router does no arithmetic on the ID and the value is only interpolated into a String for the Strava HTTP requests so the library still compiles and works with this change. THIS IS A BREAKING CHANGE for programs that call the `request` function as the embedded ID parameter needs to change from Int to String - however it's a simple change from `id: id` to `id: "\(id)"`
`gearID` added as `String` with init. This property is included in athlete activities (this is different from detailed activity which returns a Gear struct)
Change typealias Id from Int to String
Fixed missing string terminator in gear_id initialiser
Added properties to maintain 15 min and daily Strava API counts and limits
Added key NSURLErrorKey with value response.url to hold url causing Strava API fail
Most recent 'Scope' string returned from Strava is stored and 'authorisedScope' function added to access the scope
Thanks for doing this, any chance this can be rebased on the main branch? |
I don't use this library any more as it looks like the original author is not maintaining it so I've reworked my program to use native URL requests and json decoding. As this is also a breaking change I don't want to make any changes that might impact existing users. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently the ID parameter for Strava objects is a typealias to Int in Router.swift. However ID for Strava Gear (aka Equipment) is a String, so the gear API call does not work. ID is not used in any arithmetic and is simply passed around and interpolated into a string for the Strava API calls so the library operation is not impacted by this change.
This change also adds a gear_id (String) attribute to the Activity class which was missing before
This is a breaking change for programs calling the request API function with an embedded route parameter as the id parameter to Router has changed from Int to String. However the fix is a simple interpolation (id: id becomes id: "(id)"