-
Notifications
You must be signed in to change notification settings - Fork 32
Consider optional headers for APIGatewayRequest #73
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
Hello, thank you for having reported this. It seems a legit request to me. Can you share an example of the input payload you give to your Lambda function during your tests ? |
I've thought about this more, and the question I think comes down to expected behavior for deserialization in Swift. There are many ways to pass data to the lambda, and we can't really ensure that they'll conform to I see the other option being just making the change for headers along with a suggestion to users that their functions accept a |
I just checked the new runtime (v2, on
|
Expected behavior
Making headers optional on APIGatewayRequest allows for trivial testing via test console in AWS. While it's unlikely a request will not have headers in real world usage, it's trivial to reproduce in API Gateway console during testing.
I ran into this use case while testing the integration between a simple
GET
endpoint and my Lambda. My lambda doesn't interact with headers at all, so while it's trivial to add one for testing, I'm curious if there's a specific reason that the headers aren't optional, and if they can be updated.Actual behavior
Steps to reproduce
If possible, minimal yet complete reproducer code (or URL to code)
The demo implementation at the SPM page will be adequate as long as it's triggered by API Gateway.
SwiftAWSLambdaRuntime version/commit hash
1.0.0-alpha
Swift & OS version (output of
swift --version && uname -a
)The text was updated successfully, but these errors were encountered: