Skip to content

Conversation

@aborem
Copy link
Collaborator

@aborem aborem commented Sep 5, 2025

Closes #64

I decided to have the fetch methods return values with the following type signature: tuple[list[<Vertical> | None], Any]. The first element in the tuple is the list of model objects that were parsed using the response from the API request. It's also possibly None since there may be a parsing failure. The second element is the raw response payload, which we return in case the caller wants more data than we provide in the model definition.

In this PR I wrote two Strava public methods: fetch_social_posting_vertical and fetch_physical_activity_vertical.

I also set the BaseVertical.id field to be self-generating.

@aborem aborem changed the title Aborem/strava use schemas Strava fetch methods return model objects rather than Any Sep 5, 2025
@aborem aborem requested a review from lisad September 5, 2025 20:36
@aborem aborem merged commit 2f28fda into main Sep 8, 2025
1 check passed
@aborem aborem deleted the aborem/strava-use-schemas branch September 8, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Return instance of BaseVertical model rather than Any for all Strava methods

3 participants