| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…lved route and args Introduce a Request class that provides structured access to the resolved route pattern, path parameters, HTTP method, headers, query parameters, and body. Available via app.request in middleware and via type-annotation injection in route handlers. Closes aws-powertools#7992, aws-powertools#4609
…YPE_CHECKING block
|
Sorry, something went wrong.
There was a problem hiding this comment.
Hey @oyiz-michael, thanks for this PR! This is a great addition. The Request object is much cleaner than having middleware dig into app.context or deal with API Gateway's raw {proxy+} path parameters. Really nice work on the tests too, you covered a lot of ground.
I went through the code and made a few improvements on top of your work.
I'll open a follow-up issue for documentation updates after we merge this. The middleware docs should show app.request as the recommended way to access resolved route info.
Thanks again for the contribution!
APPROVED!
Sorry, something went wrong.
Codecov Report❌ Patch coverage is 92.18750% with 5 lines in your changes missing coverage. Please review. @@ Coverage Diff @@
## develop #8036 +/- ##
===========================================
- Coverage 96.65% 96.63% -0.03%
===========================================
Files 282 283 +1
Lines 13798 13862 +64
Branches 1103 1111 +8
===========================================
+ Hits 13336 13395 +59
- Misses 339 342 +3
- Partials 123 125 +2 ☔ View full report in Codecov by Sentry.
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Issue number: closes #7992, closes #4609
Summary
Changes
User experience
Before: Middleware had no access to the resolved route pattern or extracted path parameters. app.current_event.path_parameters only contained the raw API Gateway parameters (e.g. {"proxy": "..."} for {proxy+} routes), not the Powertools-resolved values.
After: Middleware and route handlers can access a Request object with the resolved route and parameters:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.