如何访问AWS API网关的path参数?

我在API网关中创build了一个基本的GET url; 用名为“name”的path参数。

我怎样才能访问这个名字参数? 我没有看到它在任何事件或背景下。

我错误的参数path的目的?

让我用我的游戏应用程序为例:

GET /api/v1/person @controllers.PersonController.list(limit: Int ?= 50, offset: Long ?= 0) GET /api/v1/person/$id<[0-9]+> @controllers.PersonController.getById(id: Long) GET /api/v1/person/$id<[0-9]+>/email @controllers.PersonController.getEmailByPersonId(id: Long) 

这是使用AWS API网关实现的吗?

根据文档,您应该可以使用映射模板执行此操作: http : //docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html

修改他们的例子(底部附近的“示例请求和响应”)以适应你的URI,它将看起来像这样

 //Resource: /api/v1/person/{id} //With input template(this is what your lambda will see in the event): { "id" : "$input.params('id')" "person" : $input.json('$.person') } //POST /api/v1/person/{id} { "person" : { "name": "bob" } }