Open elbalexandre opened 11 months ago
Agreed, my assumption was that if I was providing a zod schema, the data was being validated, particularly because the event
property handed to my function is typed according to the schema. This means that in a pretty normal webhook case, the type can be pretty easily wrong.
There's a preliminary PR for this over at #657. Leaving this issue open to continue to gather feedback, but you can use that PR to get going now if you need this before we add a first-party option. 🙂
Is your feature request related to a problem? Please describe. Event data is not validated against Zod schemas used for defining Inngest client event schemas.
Describe the solution you'd like When Zod schemas are used, the
send()
function should validate the provided data against the corresponding Zod schema.Describe alternatives you've considered An alternative could be to remove
EventSchemas.fromZod
. This might be less ambiguous, as users familiar with Zod know they can use z.infer.Additional context N/A