awslabs / aws-lambda-go-api-proxy

lambda-go-api-proxy makes it easy to port APIs written with Go frameworks such as Gin (https://gin-gonic.github.io/gin/ ) to AWS Lambda and Amazon API Gateway.
Apache License 2.0
1.06k stars 198 forks source link

add query string param and path param into header and context #121

Open caevv opened 2 years ago

caevv commented 2 years ago

Description of changes:

Add API gateway path parameters and query string parameters into the header and context.

More important on this PR is the Path Parameter as this cannot be extracted any other way, happy to remove the query string parameter.

sapessi commented 2 years ago

What's the use-case for getting path parameters this way and not through the framework itself? For example in gin you'd write:


router.GET("/user/:name/*action", func(c *gin.Context) {
        name := c.Param("name")
        action := c.Param("action")
        message := name + " is " + action
        c.String(http.StatusOK, message)
    })```
drakejin commented 1 year ago

@sapessi Do you think It's not aws-lambda-go-api-proxy's responsibility to directly manipulate path and query parameters?

Therefore, You recommend using well-known HTTP frameworks for manipulating path or query parameters. isn't it?