-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Changes to Blueprints application breaks multiply applied routes!!! #1742
Comments
@benjolitz The original change in #1690 was done in order to account for an old standing open issue that actually needed fixing. I missed this case when implementing the change that seems to have broken the case of multiple routes being bound to the same handler method. Let me see what can be done to address this while still being able to handle the original request from #37 |
@harshanarayana okay. wrong username for me btw. ;) |
@autumnjolitz oh. Sorry. That explains why the auto complete wasn't working last night. 😂 sorry about the mistake |
Hi @autumnjolitz
|
…re inspection crash Fix sanic-org#1742
* Allow route decorators to stack up without causing a function signature inspection crash Fix #1742 * Apply fix to @websocket routes docorator too Add test for double-stacked websocket decorator remove introduction of new variable in route wrapper, extend routes in-place. Add explanation of why a handler will be a tuple in the case of a double-stacked route decorator
Thank you @ashleysommer ! |
Consider the following pattern:
The recent change in #1690 breaks that pattern.
It's a common pattern to use multiple
@blueprint.get(...)
and@app.get(...)
to handle routes that have common behavior with slight variations, like a login process.The only alternative I can think of is splitting out each of these routes into distinct rump functions that literally forward onto a common function, which inflates from one line declarations to three lines plus the constant common route handler.
The text was updated successfully, but these errors were encountered: