validated
validated(
schema):PipelineBehaviorTuple<ZodValidationBehavior,ZodValidationOptions>
Defined in: packages/pipeline-zod/src/helpers/validated.intent.ts:22
The entry that validates an operation’s input against schema and hands the handler
the parsed copy.
Parameters
Section titled “Parameters”schema
Section titled “schema”ZodType
Returns
Section titled “Returns”PipelineBehaviorTuple<ZodValidationBehavior, ZodValidationOptions>
Example
Section titled “Example”export const order = pipeline.wrap( { name: 'order', kind: 'command' }, validated(z.object({ sku: z.string(), qty: z.coerce.number().int().positive() })),)(async (input) => orders.place(input));