Skip to content
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

Reduce verbosity in GenerateRoutes #3175

Merged
merged 2 commits into from
Sep 12, 2022
Merged

Conversation

dnephin
Copy link
Contributor

@dnephin dnephin commented Sep 9, 2022

Summary

Most routes in GenerateRoutes are added with a single. We have a few special cases that have to set fields on the route definition, which makes them more verbose.

This PR changes add to accept the method and path separate from the route struct. This allows us to move the route definition to a package-level variable, and keep GenerateRoutes to a single line per route.

So that we can include route definitions from package-level variables, while keeping
the route identifier (the method and path) as part of the call to add the route to a group.
So that GenerateRoutes reads clearly without having to skip over long route
definitions.
Copy link
Collaborator

@BruceMacD BruceMacD left a comment

Choose a reason for hiding this comment

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

looks good

@dnephin dnephin merged commit ce97fb7 into main Sep 12, 2022
@dnephin dnephin deleted the dnephin/api-use-route-definition branch September 12, 2022 19:47
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.

2 participants