Summary
paymentOptionSchema treats network as optional, but when the field is present both schemas still accept an empty string:
- valibot:
network: v.optional(v.string())
- zod:
network: z.string().optional()
So { ..., network: "" } parses successfully. An empty network is not a meaningful CAIP / chain hint; it is the same class of empty-field hole that #183 covers for id / currency / recipient, just on the optional field.
Affected files
packages/ack-pay/src/schemas/valibot.ts
packages/ack-pay/src/schemas/zod.ts
Expected
If network is present, require a non-empty string (same nonEmptyString / min(1) shape as the other identifier fields). Omitting the field remains valid.
AI usage
Filed with Cursor assistance while scanning for schema gaps not covered by open PRs. I reviewed the schema lines above and take responsibility for the report.
Summary
paymentOptionSchematreatsnetworkas optional, but when the field is present both schemas still accept an empty string:network: v.optional(v.string())network: z.string().optional()So
{ ..., network: "" }parses successfully. An empty network is not a meaningful CAIP / chain hint; it is the same class of empty-field hole that #183 covers forid/currency/recipient, just on the optional field.Affected files
packages/ack-pay/src/schemas/valibot.tspackages/ack-pay/src/schemas/zod.tsExpected
If
networkis present, require a non-empty string (samenonEmptyString/min(1)shape as the other identifier fields). Omitting the field remains valid.AI usage
Filed with Cursor assistance while scanning for schema gaps not covered by open PRs. I reviewed the schema lines above and take responsibility for the report.