Skip to content

bug(ack-pay): paymentOptionSchema accepts an empty network string #219

Description

@kutluhaneth46

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions