Skip to content

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

Closed
@to-mc

Description

@to-mc

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions