Skip to content

Commit 9a8d425

Browse files
authored
docs(event_handler): update test section (#7374)
Update assert_rest_api_resolver_response.py Document necessary usage of strings for query parameters on events. Signed-off-by: Andrés Álvarez <[email protected]>
1 parent 91cd698 commit 9a8d425

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/event_handler_rest/src/assert_rest_api_resolver_response.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ def test_lambda_handler(lambda_context):
2222
"path": "/todos",
2323
"httpMethod": "GET",
2424
"requestContext": {"requestId": "227b78aa-779d-47d4-a48e-ce62120393b8"}, # correlation ID
25+
# Always use strings when using query parameters. API Gateway automatically converts them to strings
26+
"queryStringParameters": {"page": "5", "foo": "bar"},
2527
}
2628
# Example of API Gateway REST API request event:
2729
# https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html#apigateway-example-event

0 commit comments

Comments
 (0)