Replies: 2 comments 3 replies
-
Hello @dmarr, We are discussing an improvement to our documentation in this issue: #2962. This case you brought may even be a bug, I need to investigate further. What do you think about adding your thoughts and findings there so we can create a PR to fix/improve our documentation and even bugs if any? Thank you. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Could you move the catch all route to be defined last in your code and try
again plz?
**Reasoning**
That’s because routes are registered in the order they are defined - we
split static from dynamic routes to find the most specific (along with
dynamic args)
In this case, both routes are dynamic. As such, catch all route is always
triggered before any route has a chance for a match.
It’d be great to hear what your intent is. I assume you’d want to have a
route to fallback to, e.g., custom 404 response (we do by default but you
may have your reasons).
**Next**
As Leandro suggested. We should add a safeguard in the apigateway.py to
detect whether a catch all route like this was registered, so we try for a
match as a last option (assuming that’s the original intent here).
…On Fri, 18 Aug 2023 at 22:39, Leandro Damascena ***@***.***> wrote:
Hello @dmarr <https://github.com/dmarr>, We are discussing an improvement
to our documentation in this issue: #2962
<#2962>.
This case you brought may even be a bug, I need to investigate further.
What do you think about adding your thoughts and findings there so we can
create a PR to fix/improve our documentation and even bugs if any?
Thank you.
—
Reply to this email directly, view it on GitHub
<#2976 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZPQBADX6S5HAYGYACEMFDXV7HHPANCNFSM6AAAAAA3V6ZPZI>
.
You are receiving this because you are subscribed to this thread.Message
ID:
<aws-powertools/powertools-lambda-python/repo-discussions/2976/comments/6765035
@github.com>
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the documentation, it is stated in the section about
catch-all
routes the following:I understood this to mean that in the case where a more specific match is found, that it will pick the more explicit match over the other. For instance:
In this case, I would think from the docs that a request to
/my/resource/12345
would invokemore_explicit
, but in practice I see the opposite happen (catch_all
is invoked for everything).I am wondering if I misinterpreted the docs, or if there is some other issue in my own code that I am overlooking. Really a sanity check here.
Beta Was this translation helpful? Give feedback.
All reactions