sst / sst

Build modern full-stack applications on AWS

Home Page:https://sst.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: createEventBuilder validator parameter no longer optional?

brifiction opened this issue · comments

Hello SST Community,

I need help confirming the current function of createEventBuilder, with a question about it.

Summary

I was upgrading the SST project to latest (beyond 2.39.0) and have noticed the Event Bus createEventBuilder change, such as below:

import { createEventBuilder, ZodValidator } from "sst/node/event-bus"
const event = createEventBuilder({
  bus: "MyBus",
  validator: ZodValidator
})

Previously, validator prop was "optional", but now the function returns TypeError when validator is undefined.

Question

Is the validator prop now required to use createEventBuilder? If so, great - I'll keep this in mind for future reference.

Just want to confirm if validator is required now and beyond.

Thanks!

FYI, answered my own question - I thought validator prop existed before, but it was just other props I vaguely remembered in the past (that's metadata, metadataFn and so on).

image

Love this new feature with the validator, look forward for more things to come! Thanks sst community!