Skip to content

docs: fix mini-v4 docs related to min/max validation #4547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025

Conversation

wancup
Copy link

@wancup wancup commented May 28, 2025

Based on the Defining schemas page, I tried using z.string().check(z.maximum(5)) with zod/v4-mini, but got the following type error:
Argument of type '$ZodCheckLessThan<Numeric>' is not assignable to parameter of type 'CheckFn<string> | $ZodCheck<string>'.

The zod-mini doc page suggest using methods like z.maxLength() with z.string().check(), so I updated the Defining schemas page.

I also fixed the documentation for bigint and number APIs to use minimum/maximum instead of min/max.

@colinhacks
Copy link
Owner

Whoops. Good catch! Thanks!

@colinhacks colinhacks merged commit e8a8491 into colinhacks:main May 28, 2025
4 checks passed
@wancup wancup deleted the fix-v4-mini-docs branch May 29, 2025 00:01
timorthi pushed a commit to timorthi/zod that referenced this pull request Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants