I have built 100s of APIs and Lambdas and never had to go through such a discussion.
I always used proxy integration and parsed the parameters in my code using this
x = event['queryStringParameters']
ID = x.get("param1")
name = x.get("param2")
However, the front-end engineer is arguing that we should follow the recommended naming convention and pass parameters to our APIs as path parameters same as in this link https://restfulapi.net/resource-naming/ After some research, I found that this is basically non-proxy integration and I should configure the param in API GW. I read in many blogs that this is not the recommended way though. but I can not find a clear AWS doc that explicitly prefers proxy integration.
proxy(path param): http://api.example.com/device-management/managed-devices/{id}
non-proxy(query string param): http://api.example.com/device-management/managed-devices?param1={id}
I have been trying to convince him that I have not seen this being used anywhere and that the APIs URLs are used in the app code so why does the look of the API url matter?!!
PLEASE, I need your opinions in this. Tell me what you think?
Lambda Proxy Integration sent the request directly from the client to the lambda function without any modifications. It directly maps one URL to one lambda function. Therefore it is not possible to use path parameters with this setup..
Update: It is possible to use path parameters using {path}
segment in the URL as described in this AWS documentation
Lambda Integration can modify the request before sending it to the Lambda function also modify the response from the same function before sending it to the client. With Lambda Integration, an API designer has more control over the APIs rather than burying API definitions into the code. It's easy to generate swagger API specification from the API Gateway Velocity Template Language (VTL).
Lambda Proxy Integration is recommended for rapid prototyping but Lambda Integration is recommended for a mature REST API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With