-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Localstack API Gateway does not understand request-parameters #229
Comments
Is it planned to fixe it any time soon? |
@sshogunn I am presently working on this. Don't know how fast progress will be though. |
@whummer Where might I start looking? I can't seem to find the code that handles API Gateway's Am I right in assuming that this functionality has not yet been implemented? |
@KamuelaFranco For the basic "CRUD" functionality of API Gateway we're using The way it works is that we're using
(The default ports can be found in https://github.com/localstack/localstack/blob/master/localstack/constants.py#L18-L43 ) The proxy follows a simple protocol by implementing 2 methods: The proxy implementation for API Gateway can be found here: https://github.com/localstack/localstack/blob/master/localstack/services/apigateway/apigateway_listener.py#L81 Given that your planned changes affect mostly the integration part (rather than the CRUD part), it probably makes more sense to add this functionality to EDIT: Actually, I feel like adding request parameters has some similarities with mapping templates: http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html. They both store a static string with variable placeholders which are then replaced with actual parameter values at invocation time. An example for how we apply/transform mapping templates can be found here: https://github.com/localstack/localstack/blob/master/localstack/services/apigateway/apigateway_listener.py#L100 Hope that helps as a starting point. Please keep me in the loop and let me know if there are any questions. Thanks (Btw, we've been planning for a long time to write up some developer documentation, the above may serve as a good starting point. I'm going to start a wiki/README page on that.) |
@whummer The approach I'm working on so far is entirely encompassed in |
This should be fixed in the meantime. Closing this issue - please re-open if the problem persists. Thanks |
It seems that this issue is not fixed, please see #3448 |
I have successfully created, deployed and invoked a JavaScript Lambda function through a REST API created in API Gateway, all in Localstack. This is using the Lambda Proxy Integration as described here : http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-simple-proxy.html#api-gateway-set-up-lambda-proxy-integration-on-proxy-resource
However, if I introduce a path parameter to the resource, localstack fails to route the HTTP request and instead complains that the API Gateway endpoint for my method cannot be found. It would appear that localstack's API Gateway implementation does not process
request-parameters
, as described here : http://docs.aws.amazon.com/cli/latest/reference/apigateway/put-method.htmlBelow I give full steps to reproduce the error.
Note: This was produced using the latest localstack Docker image:
Create a file
index.js
with these contents:Then use
awslocal
to create a Lambda function, create a REST API and deploy it:The above should deploy an endpoint
GET /{somethingId}
which responds with a body containing the path parametersomethingId
. However, localstack fails to find the resource method entirely:Doing similar on real AWS gives the expected result:
The text was updated successfully, but these errors were encountered: