-
Notifications
You must be signed in to change notification settings - Fork 153
Bug: parser built-in schema accept empty Records
array
#3475
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
success
Hi @Jimmy89, thank you for opening this issue. I can confirm that if |
Thank you @dreamorosi for putting it in the current iteration. |
Yes, I haven't checked all of them, but from spot checking a couple of them, all the built-in schemas we have that use If you agree I'd like to modify the title of the issue to reflect this, so we can get them all fixed. |
@dreamorosi go ahead and adjust the title/content |
Just my 2 cents here... I agree that events that any service sends to Lambda have at least one record. Some of them (S3, Kinesis, SQS, SNS and others) are a group of records - a list - and TS Parser should not accept an empty list. In theory, empty events will never happen in the real world (Services -> Lambda), but based on what you're trying to achieve, @Jimmy89 , and to improve the developer experience/feedback loop, yes, we need to validate this in our models. |
success
Records
array
I have started working on making changes to some of the schemas to address this bug.
I'll continue adding the |
This issue is now closed. Please be mindful that future comments are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so. |
Reopening as there're still a few schemas to fix in #3521 |
This issue is now closed. Please be mindful that future comments are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so. |
This is now released under v2.13.1 version! |
Expected Behavior
Trying out the S3Schema parser with an empty records array passes validation. This should not occur.
Current Behavior
Output of
success
is true, whilefalse
was expected.Code snippet
Steps to Reproduce
Run code snippet above
Possible Solution
No response
Powertools for AWS Lambda (TypeScript) version
"@aws-lambda-powertools/parser": "2.13.0"
AWS Lambda function runtime
22.x
Packaging format used
npm
Execution logs
The text was updated successfully, but these errors were encountered: