-
Notifications
You must be signed in to change notification settings - Fork 807
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
Schema example in README.md not work #595
Comments
UPDATE: "class-validator": "^0.11.1" works but email value had to add constraints: []... |
I'm seeing exactly the same. "v0.11.1" returns array of validation errors, where "v0.12.2" returns empty array. I've looked through the changelogs for any breaking changes, but couldn't find anything related. |
It is related to last big refactor. We do not have tests for schema features so I do not realised we broke this feature completely. |
@vlapo is any update on the issue |
so I wasted half a day debugging class-validator trying to figure out what AM I doing wrong. You might ask, why didn't I search the open issues instead of wasting that much time? ok, well, who would have thought that any library could fail the most basic scenario? a validation library that can't perform any validation is unheard of. So, as everyone here, I'm wondering is there's any update on this issue and is this project is still alive? I understand that open source developers have other responsibilities, but please set the expectations of anyone using your code right. |
FYI, soon we I will open a discussion about removing the schema validation functionality at all from class-validator. There are libraries dedicated for that, so we should not roll our own but focus on the decorator based validation. |
@NoNameProvided Can you suggest a package which does schema validations (Typescript) |
@akshayr-tavisca I use Joi in my current project |
@NoNameProvided Is there any update on this issue whether your are going to include it in the future or not. |
The feature, schema based validation, is broken since the PR #568 , we can easily see that it was a bit known with those changes : https://github.com/typestack/class-validator/pull/568/files#diff-8ad828b3cb077e586ecc20d38c15cd197e1efc9bf537cb8c985b845b63d97138L16 😢 |
Hi guys! How's the issue going? There's something we can do to help? |
Why not at least update the README and say "Don't even try"? Also spent a whole day debugging this :| |
Hi guys! Any update on this, about 2.5 years later? |
Thanks for bumping this (I had no idea this features was broken), but this issue will probably not see a lot of action in the near future, as we have quite low maintainer activity and no way to add more maintainers. See #1719 |
I agree with @NoNameProvided here. This feature seems like a tacked on afterthought to me. For schema based validation, I would recommend zod. Duplicate of this issue: #1155 |
As mentioned in the thread, schema-based validation is deprecated and will be removed. The documentation has been updated, it now contains a suggestion of what libraries to use instead of class-validator. To clarify, I am closing this issue as wontfix. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I just copy and paste, change object value and try to trigger errors...but result shows empty array...
please help, give me some clues... i was trapped by this in hours...thank you
----------- terminal info ---------------
[]
Validation succeed.
The text was updated successfully, but these errors were encountered: