zod icon indicating copy to clipboard operation
zod copied to clipboard

$ZodTypeDef lists redundant types: "int" and "interface"

Open RobinTail opened this issue 7 months ago • 0 comments

If you do z.$ZodTypes["_zod"]["def"]["type"] there would be no such type as "int" or "interface" (that one was removed).

(see also docs: https://zod.dev/packages/core?id=schemas)

However, $ZodTypeDef["type"] contains another (possibly duplicated) list of literals including "int" and "interface":

Image

I suggest either to remove them or to express one via another.

The obstacle is number format check, which is using "int" in the place of "expected" type, that does not really exist as a schema's type.

Image

Here I suggest to use "invalid_format" issue instead (which is currently only devoted to strings), but should be also applicable to numbers.

RobinTail avatar May 24 '25 07:05 RobinTail