Skip to content

fix: null deserialization of stageVariables for sam local #366

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

Merged
merged 2 commits into from
Nov 17, 2021

Conversation

nmoutschen
Copy link
Contributor

Issue #, if available: #365

Description of changes:

Add support for deserializing API Gateway v2 payloads when stageVariables is set to null.

AWS SAM local sends a payload that contains a null value for stageVariables, which causes the deserialization into a lambda_http::request::LambdaRequest to fail. This makes this field deserializable using the nullable_default function to handle that edge case.

Open question: should we also make this change to all fields that deserializes into a StrMap?

By submitting this pull request

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I confirm that I've made a best effort attempt to update all relevant documentation.

@coltonweaver
Copy link
Contributor

Open question: should we also make this change to all fields that deserializes into a StrMap?

In favor of your robustness comment in the issue related to this, I think it makes sense to do this. Overall the change looks good. Do you want to include this in this PR? I'll approve but feel free to push up the change to do that.

@nmoutschen
Copy link
Contributor Author

In favor of your robustness comment in the issue related to this, I think it makes sense to do this. Overall the change looks good. Do you want to include this in this PR? I'll approve but feel free to push up the change to do that.

Will do - better to do it in one go. I'll let you review before merging to get another pair of eyes. :)

@coltonweaver
Copy link
Contributor

Looks good, thanks!

@coltonweaver coltonweaver merged commit 576f601 into awslabs:master Nov 17, 2021
@nmoutschen nmoutschen deleted the request-sam-local branch November 19, 2021 22:25
@nmoutschen nmoutschen added the 0.5 label Feb 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants