Skip to content

an enum for the API Endpoints#744

Open
krugerk wants to merge 20 commits intobeeminder:masterfrom
krugerk:feature/endpoint-enum
Open

an enum for the API Endpoints#744
krugerk wants to merge 20 commits intobeeminder:masterfrom
krugerk:feature/endpoint-enum

Conversation

@krugerk
Copy link
Copy Markdown
Contributor

@krugerk krugerk commented Feb 24, 2026

Summary

Trying a type for the API endpoint. Avoids much of the manual string manipulation and substring replacement.
Also provides a SSoT with regard to the url for an endpoint - the rest of the app does not need to deal with url paths, parameters, or http verbs.
Several places that had access to a username now pass it along rather than relying on the request manager to perform the substitution.

@krugerk krugerk requested a review from a team as a code owner February 24, 2026 17:24
@krugerk krugerk requested review from theospears and removed request for a team February 24, 2026 17:24
url: "api/v1/users/{username}/goals/\(goal.slug)/datapoints/\(datapoint.id).json",
parameters: params

let _ = try await requestManager.request(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_ = ...

Can also be used throughout, without the let.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would include SwiftLint for checking this

@krugerk krugerk force-pushed the feature/endpoint-enum branch from d46a6f0 to ded094d Compare March 2, 2026 22:55
@krugerk krugerk changed the title from string manipulation to a type for the api endpoint an enum for the API Endpoints Mar 2, 2026
@krugerk krugerk force-pushed the feature/endpoint-enum branch from ded094d to 96f760f Compare March 10, 2026 22:34
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could easily be its own should this PR be too big/busy

@krugerk krugerk force-pushed the feature/endpoint-enum branch from 52b9e75 to 53e0be5 Compare March 30, 2026 14:52
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.

1 participant