-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Scope macro #3136
Scope macro #3136
Conversation
Co-authored-by: oliver <151407407+kwfn@users.noreply.github.com>
Done a bit of re-organization and docs tweaking. Think it's in a good state to merge. One more thing I want to add is to disallow trailing slashes to align with this piece of documentation and it's reasoning: https://docs.rs/actix-web/latest/actix_web/struct.Scope.html#avoid-trailing-slashes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great work 👍🏻 thanks for being patient for the review 🙃
PR Type
Start of adding proc macro scope feature based on issue #1709.
PR Checklist
Overview
Like the project the issue referenced, I added scope proc macro that takes a path. I couldn't figure out how the rest of the features would work int he referenced project so did not implement them.
This is my first major pull request. I decided to remove non path arguments to the scope proc macro to reduce the size of this pull request assuming there may be other issues given my inexperience. Also the issue references a handler macro that I did not implement because I wasn't sure exactly if perhaps that was covered by a get macro or should be something more.
Issue #1709
For example, the scope macro together with a prefix path would be declarated before module like below.
Then, web methods in the module would get the prefix path concatenated to the path argument.