Skip to content

Route path parameters only available when using enable_validation=True? #6177

Answered by aalvrz
aalvrz asked this question in Q&A

You must be logged in to vote

@leandrodamascena Sorry I think this was a misunderstanding from my part when writing my unit tests, although I had to spent quite some time trying to figure this out.

Basically I was creating my test event like this:

event = {"path": "/box/<box_id>/send", "httpMethod": "POST", "pathParameters": {"box_id": "foobar"}}

And I thought that was what the resolver expected. But apparently this was the correct way:

event = {"path": f"/box/{my_box_id}/send", "httpMethod": "POST"}

Maybe this needs some more examples in the documentation.

Replies: 1 comment 3 replies

You must be logged in to vote
3 replies
@leandrodamascena

@aalvrz

Answer selected by leandrodamascena
@leandrodamascena

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants