SchemaOptions
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
M |
Properties
Section titled “Properties”onInvalid?
Section titled “onInvalid?”readonly optional onInvalid?: OnInvalid;Observe validation failures instead of the default development warning.
schema?
Section titled “schema?”readonly optional schema?: SchemaMap<M>;Validate payloads against a Standard Schema
before trusting them — any Zod, Valibot or ArkType schema, or anything else
exposing ~standard.
Without this, an inbound payload is cast, not checked: a peer running last week’s deploy sends whatever that build thought the shape was, and the receiving code reads it as whatever this build’s types say. That is the one place in this library where a type is a hope rather than a guarantee, and a rolling deploy is what turns it into a bug.
Validation runs in both directions. Inbound, a failure drops the payload — the same choice the envelope makes for a wire it cannot read. Outbound, it throws, because a value your own code just produced and cannot describe is a bug in this tab, and finding it here beats finding it in someone else’s.