-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feature request: Support of $context.requestOverride.status|querystring in apigateway #12621
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
Comments
Welcome to LocalStack! Thanks for reporting your first issue and our team will be working towards fixing the issue for you or reach out for more background information. We recommend joining our Slack Community for real-time help and drop a message to LocalStack Support if you are a licensed user! If you are willing to contribute towards fixing this issue, please have a look at our contributing guidelines. |
Hi @pieronatan, thank you for your report of this bug in LocalStack. I am trying to get a good understanding of your use case so I can get to the issuemore quickly. Can you tell me which integration you are using, as it sometimes impacts how ApiGw behaves with VTL template and overrides. Also, I assume you are using a lambda authorizer and using it's response in the authorizer context?
I believe there may be a gap in our VTL implementation when attempting to use
Please, let me know if I am missing anything. |
I'm using a Lambda authorizer that returns custom metadata via the context object, including a statusCode. In my mapping template, I dynamically override the response status based on this value using context.responseOverride.status. Attempts to hardcode the status code (e.g., setting it directly to a fixed value) resulted in errors.
|
Thank you for the extra input I had time to run some quick test as well. I will keep you updated as the fix becomes available. |
Hello @pieronatan and thanks for your report! One fix for your issue by @cloutierMat has been merged and is available in the You can now correctly override your response status code in your request templates. However, we are still working on a fix concerning the assignation via However I could validate that you can use a workaround that also works in AWS: You can replace the following line: With the following that has the exact same effect: It also works on AWS, and will work in LocalStack. I hope this workaround can unblock you until we can properly fix the issue. (beware however that it returns the value of the I'll still leave the issue open until we get the right fix. Thank you! |
Hello @pieronatan, Thank you for your patience as we are resolving this issue. I submitted a fix in the |
Is there an existing issue for this?
Feature description
LocalStack does not currently support overriding:
responseOverride.status
to set HTTP response statusrequestOverride.querystring
to inject query parameters into the integration requestBoth work correctly in AWS API Gateway when using Velocity templates (VTL), but fail in LocalStack.
Examples
Override response status code (VTL):
In AWS → returns HTTP 200.
In LocalStack → returns HTTP 200, or fails with:
Environment
🧑💻 Implementation
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: