Skip to content

ApiGatewayResolver doesn't allow passing a list of methods to the route decorator #837

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

Closed
to-mc opened this issue Nov 19, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@to-mc
Copy link
Contributor

to-mc commented Nov 19, 2021

What were you trying to accomplish?
Add a function to handle multiple http methods using the ApiGatewayResolver:

app = ApiGatewayResolver(proxy_type=ProxyEventType.APIGatewayProxyEventV2)
@app.route("/", method=["GET", "PUT", "POST"])
def event_handler():
    return {"path_received": app.current_event.path, "method": app.current_event.http_method}

Expected Behavior

It should be supported to pass a list of methods to ApiGatewayResolver.route, the same way it is supported for the Router.route method.

Current Behavior

Exception is thrown.

Solution

PR on its way

@to-mc to-mc added bug Something isn't working triage Pending triage from maintainers labels Nov 19, 2021
@to-mc to-mc self-assigned this Nov 19, 2021
@to-mc to-mc added area/event_handlers and removed triage Pending triage from maintainers labels Nov 19, 2021
@to-mc to-mc added the pending-release Fix or implementation already in dev waiting to be released label Nov 22, 2021
@heitorlessa
Copy link
Contributor

Now released as part of 1.23 version

@heitorlessa heitorlessa removed the pending-release Fix or implementation already in dev waiting to be released label Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants