-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add custom Decodable
conformance
#76
Conversation
Decodable
conformance
Thank you @twistinside for the PR. This changes the signature of the API and will require a version change. Can you update the new code to pass the |
I was seeing the same failure in |
I ran the soundness check, here's the output:
|
Add custom Decodable conformance. Closes #73 Duplicate of #76 created by @twistinside **Motivation:** Absent collections would fail to decode, when in reality it is possible to have empty headers, for example. This allows processing to continue in the context of the Lambda runtime where users can handle the collections as dictated by their code. **Modifications:** Custom Decodable conformance has been added to both API Gateway request objects to optionally decode absent collections to empty collections. Unit testa have been added for the same. **Result:** This will make the swift lambda runtime more accepting of input, allowing processing to proceed in the rare cases where collection fields would be absent in the JSON received by the runtime. This will unlock certain functionality in edge cases such as testing lambda code from API Gateway console with empty headers (the use case that prompted this change). This change will require users to update their code to remove optional handling for the collections involved, potentially also requiring extra logic to validate that the collections they've received aren't empty. --------- Authored-by: twistinside <[email protected]>
Add custom
Decodable
conformance. Closes #73Motivation:
Absent collections would fail to decode, when in reality it is possible to have empty headers, for example. This allows processing to continue in the context of the Lambda runtime where users can handle the collections as dictated by their code.
Modifications:
Custom
Decodable
conformance has been added to both API Gateway request objects to optionally decode absent collections to empty collections.Unit testa have been added for the same.
Result:
This will make the swift lambda runtime more accepting of input, allowing processing to proceed in the rare cases where collection fields would be absent in the JSON received by the runtime. This will unlock certain functionality in edge cases such as testing lambda code from API Gateway console with empty headers (the use case that prompted this change).
This change will require users to update their code to remove optional handling for the collections involved, potentially also requiring extra logic to validate that the collections they've received aren't empty.