-
Notifications
You must be signed in to change notification settings - Fork 343
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
Cannot deserialize API Gateway v2 HTTP Request when only apigw_http feature is specified in Cargo.toml #888
Comments
Your payload example shows that you're not receiving payloads from an APIGW HTTP endpoint, but an APIGW Rest endpoint. The
If your integrating send events from APIGW HTTP, the version would be |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Thank you @calavera for your quick answer. The payload actually came from an authentic HTTP API Gateway v2. But you are correct, the 1.0 payload compatibility was activated on it. As I understand, |
This is the first time I see version 1 being used with an HTTP endpoint, tbh. The feature name is just to indicate how we part the event payloads, but it really doesn't matter where they come from. I'm ok documenting this in the readme. |
I have deployed an HTTP API (Amazon Api Gateway v2) with a Rust lambda backend, but I am facing some problems with request deserialization. I am not sure if it is a bug or a mistake on my side, but it seems the lambda-http module only recognize an Amazon API Gateway v2 HTTP Lambda Proxy Integration Request format when both
apigw_rest
andapigw_http
features are enabled. I expected to enable onlyapigw_http
feature when working with HTTP APIs (apigateway v2).The behavior is:
features = ["apigw_http"]
in Cargo.toml, any request thows the error:this function expects a JSON payload from Amazon API Gateway, Amazon Elastic Load Balancer, or AWS Lambda Function URLs, but the data doesn't match any of those services' events"
features = ["apigw_rest", "apigw_http"]
in Cargo.toml: it worksBelow are the resources to reproduce the issue.
Lambda source code
Invalid Cargo.toml
Working Cargo.toml configuration
JSON Event from API integration reproducing the problem
The text was updated successfully, but these errors were encountered: