-
Notifications
You must be signed in to change notification settings - Fork 361
Data did not match any variant of untagged enum LambdaRequest with SAM local #365
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
If I change |
This might be an issue with SAM local. API Gateway omits those null valued properties. |
Agree that this is probably an issue on SAM local, but that might be a possibility we need to deal with from a robustness principle perspective. |
I got a similar error when using the Test Method functionality of the API Gateway in the AWS Console, not related to SAM. I can see that the request sent to the lambda has:
This happens for a deployment that used to work just fine until an unrelated lambda code change got deployed for testing. |
@ionionascu Could you retry by using the git version of the You can do that by replacing the dependency like this in your lambda_http = { git = "https://github.com/awslabs/aws-lambda-rust-runtime/lambda-http" } |
I'll close this issue since the PR is merged, but let me know if it doesn't work for you @ionionascu |
@nmoutschen , I have raised another issue, #367, as I think my problem has a different cause. I am testing with |
When running a Lambda function in Rust using the
lambda-http
crate withsam local start-api
and an HttpApi event, the Lambda runtime is not able to deserialize the payload sent by SAM into a LambdaRequest.I've created a minimum reproducible sample that just takes an event received by a Lambda function running locally in another language, and try to deserialize it into a
lambda_http::request::LambdaRequest
:The text was updated successfully, but these errors were encountered: