Closed
Description
Expected Behaviour
When there are two routes:
- GET /studies/fetch
- GET /studies/{studyid}
And a request is sent to /studies/fetch, the request should be routed to the first endpoint.
Current Behaviour
Request if routed to the second endpoint.
Code snippet
from aws_lambda_powertools.event_handler import APIGatewayRestResolver
app = APIGatewayRestResolver()
@app.get("/studies/<studyid>")
def get_study(studyid):
return "get_study"
@app.get("/studies/fetch")
def fetch_studies():
return "fetch_studies"
def handler(event, context):
return app.resolve(event, context)
Possible Solution
No response
Steps to Reproduce
Create a SAM project with the snippet as a lambda.
Invoke with /studies/fetch
Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.10
Packaging format used
Serverless Application Repository (SAR) App
Debugging logs
No response