Skip to content
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

Wrong error message when validations in union member fail #577

Open
i-am-ian opened this issue Jun 21, 2024 · 0 comments
Open

Wrong error message when validations in union member fail #577

i-am-ian opened this issue Jun 21, 2024 · 0 comments

Comments

@i-am-ian
Copy link

Hi,

First I just want to say that I really appreciate all the work that's being put into deepkit, I'm really enjoying it.

I recently came across an issue (I'm using deepkit/type 1.0.1-alpha.151):

class MyClass {
    code!: (string & MinLength<1> & MaxLength<2>) | null;
}

When validation of code fails due to specifying an empty string or a string with length > 2 I correctly get a validation error. However, the error message I get is No valid union member found. Valid: string | null.

Instead, I would expect to receive either Min length is 1 or Max length is 2.

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

No branches or pull requests

1 participant