-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
Given this schema:
const testSchema = z.array(z.number()).length(4);
For arrays with less than 4 elements, it returns the message:
Should have at least 4 items
For arrays with more than 4 elements, it returns the message:
Should have at most 4 items
I wish instead for it to return a message explaining that it should be precisely 4 items:
Should have exactly 4 items
I know I could achieve that with a custom refine validation, but it would be nice to have it baked in.
Of course, if you find this suggestion valid, I could make a PR for it.
Metadata
Metadata
Assignees
Labels
No labels