Skip to content

Commit 937be64

Browse files
authored
fix(parser): set min length of 1 to s3 event lists (#3524)
1 parent 5bb4a6a commit 937be64

14 files changed

+186
-84
lines changed

packages/parser/src/schemas/s3.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ const S3EventNotificationEventBridgeSchema = EventBridgeSchema.extend({
166166
* @see {@link https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-content-structure.html}
167167
*/
168168
const S3Schema = z.object({
169-
Records: z.array(S3RecordSchema),
169+
Records: z.array(S3RecordSchema).min(1),
170170
});
171171

172172
const S3SqsEventNotificationRecordSchema = SqsRecordSchema.extend({
@@ -204,7 +204,7 @@ const S3SqsEventNotificationRecordSchema = SqsRecordSchema.extend({
204204
* @see {@link types.S3SqsEventNotification | S3SqsEventNotification }
205205
*/
206206
const S3SqsEventNotificationSchema = z.object({
207-
Records: z.array(S3SqsEventNotificationRecordSchema),
207+
Records: z.array(S3SqsEventNotificationRecordSchema).min(1),
208208
});
209209

210210
const S3ObjectContext = z.object({

0 commit comments

Comments
 (0)