Repository navigation
Add a Strava template generated from Strava's Swagger description - #343
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
widefleet-docs | 672b1ab | Nov 23 2026, 03:41 PM |
tnkuehne
force-pushed
the
feat/strava-template
branch
from
November 23, 2026 15:03
934c09c to
34cecf6
Compare
Strava publishes its API as Swagger 2.0, with its schemas in sibling files. The OpenAPI generator now reads such descriptions: it brings the schemas of referenced files into the description, resolving references inside each file against that file, and upgrades Swagger 2.0 to the OpenAPI 3 shape it already reads. The generator's source stays Strava's published URL; with a source file, referenced files are read next to it. The generator and the REST runtime also gain form and multipart bodies, with files as UploadContent, accept 64-bit integer IDs as strings, since they may exceed what a JSON number holds, and stop on path parameters the path has no place for. OneDrive and Outlook pick up the shared runtime. The Strava template offers 30 methods for the connected athlete's profile, zones and stats, activities with laps, zones, comments and kudos, streams, clubs, gear, routes with GPX and TCX exports, segments, segment efforts and uploads. Each organization connects through its own Strava API application. Better Auth has no Strava provider, so the template uses its generic OAuth plugin; Strava's token answer names no scopes, so the scopes the athlete granted are taken from the callback. Creating and uploading activities, which followers see, asks as sending; updating activities and starring segments asks as updates.
Cover the flow Widefleet's My connections page uses: the single-use launch link, the OAuth callback, the completion link back to Widefleet, expired links, links opened by another user or twice, and a cancelled authorization returning with the error.
…enerator
- Every place in an offered path needs a path parameter to fill it; the
generator stops otherwise. Strava's description leaves out the athlete ID of
/athletes/{id}/routes, so listRoutes takes it through a new `parameters`
rule. A `fields` rule replaces, adds or removes form body fields.
- Multipart bodies write out the named schemas that carry files, so their
binary fields stay uploads; the named types keep strings for answers.
- Form lists keep their format: the Swagger upgrade writes it as the field's
encoding, and the runtime joins those lists into one value.
- Tab-separated lists join with a tab, and the delimited styles join unless
`explode` is true, as OpenAPI 3 defaults them.
- References back into the description keep its own schemas, and a file that
is one schema takes its name from the file.
…ribes Strava's API reference describes tags as form fields keyed by the tag's name, such as tags[WithPet]=true, while its description lists one `tags` string. createActivity and createUpload now take a boolean field for each supported tag in place of `tags`, through the `fields` rule.
tnkuehne
force-pushed
the
feat/strava-template
branch
from
November 23, 2026 15:15
34cecf6 to
2d8908e
Compare
…rt from references - Multipart forms send object fields, and each object of a list, as JSON parts, OpenAPI's default encoding for them. Plain forms have no encoding for objects, so the generator stops on object fields there. - With a local source file, referred files are found at their decoded path relative to the source's URL, so `Pet%20Details.json` is `Pet Details.json` and `../shared/x.json` lies beside the source's folder. - References inside literal data, such as examples, defaults, enums, constants and `x-` extensions, stay data: bundling neither loads nor rewrites them, and neither does the Swagger upgrade.
An operation that offers JSON and a form sends JSON, but the generator also checked the unused form: an object field, an unsupported list encoding or a `fields` rule on it stopped generation. The form's fields, encoding and the `fields` rule now apply only when that form is the body that is sent, and a `fields` rule without such a form stops with a clear error.
This file contains hidden or 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
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.
Change
The OpenAPI generator reads Swagger 2.0 descriptions with sibling files. Strava publishes its API as Swagger 2.0, with its schemas in separate files.
Generator and REST runtime.
UploadContent.collectionFormatand are joined into one value;tsvand the other delimited formats join in the generator and the runtime.parametersadds a parameter the description leaves out, andfieldsreplaces a body field. Strava uses them forlistRoutes' athlete ID and for the keyedtags[…]fields ofcreateActivityandcreateUpload.api.tsis unchanged.A Strava template.
STRAVA_CLIENT_IDandSTRAVA_CLIENT_SECRET. There is no managed client.send.update.template.mdpoints to Strava's API Agreement and Policy. It also covers the single-athlete capacity of new applications and Strava's default rate limits.Tests
pnpm check, the generator tests, and the Strava, OneDrive and Outlook template tests.

Confidence Score: 5/5
The PR appears safe to merge; no blocking issue remains from the reviewed changes.Summary
Adds a Strava template and Swagger 2.0 support to the generator.
Review used code inspection. No tests or live Strava calls were run during this review.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Published description] --> B[Bundle sibling schemas] B --> C[Convert Swagger to OpenAPI] C --> D[Generate typed methods] D --> E[Check user connection] E --> F{Change needs approval?} F -->|Yes| G[Ask user] G -->|Approved| H[Call Strava] F -->|No| HReviews (6) · Last reviewed commit: "Check only the form body the generator s..." · Reviewed by Greptile