-
Notifications
You must be signed in to change notification settings - Fork 847
fix: overwrite validation decorators from parent class when defined i… #2641
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
base: develop
Are you sure you want to change the base?
Conversation
**Problem** They are inheritance issues in `class-validator` (see issue: typestack/class-validator#633). We updated a PR to fix this problem: typestack/class-validator#2641. However, the chances of it ever being merged are low, as the repository no longer appears to be actively maintained. **Proposal** Use the patched package and import it via an "ugly" tarball approach. This should push us toward eventually migrating to another validation library such as Zod.
**Problem** They are inheritance issues in `class-validator` (see issue: typestack/class-validator#633). We updated a PR to fix this problem: typestack/class-validator#2641. However, the chances of it ever being merged are low, as the repository no longer appears to be actively maintained. **Proposal** Use the patched package and import it via an "ugly" github link. This should push us toward eventually migrating to another validation library such as Zod.
**Problem** They are inheritance issues in `class-validator` (see issue: typestack/class-validator#633). We updated a PR to fix this problem: typestack/class-validator#2641. However, the chances of it ever being merged are low, as the repository no longer appears to be actively maintained. **Proposal** Use the patched package and import it via an "ugly" github link. This should push us toward eventually migrating to another validation library such as Zod.
**Problem** They are inheritance issues in `class-validator` (see issue: typestack/class-validator#633). We updated a PR to fix this problem: typestack/class-validator#2641. However, the chances of it ever being merged are low, as the repository no longer appears to be actively maintained. **Proposal** Use the patched package and import it via an "ugly" github link. This should push us toward eventually migrating to another validation library such as Zod.
**Problem** They are inheritance issues in `class-validator` (see issue: typestack/class-validator#633). We updated a PR to fix this problem: typestack/class-validator#2641. However, the chances of it ever being merged are low, as the repository no longer appears to be actively maintained. **Proposal** Use the patched package and import it via an "ugly" github link. This should push us toward eventually migrating to another validation library such as Zod.
**Problem** They are inheritance issues in `class-validator` (see issue: typestack/class-validator#633). We updated a PR to fix this problem: typestack/class-validator#2641. However, the chances of it ever being merged are low, as the repository no longer appears to be actively maintained. **Proposal** Use the patched package and import it via an "ugly" github link. This should push us toward eventually migrating to another validation library such as Zod.
**Problem** They are inheritance issues in `class-validator` (see issue: typestack/class-validator#633). We updated a PR to fix this problem: typestack/class-validator#2641. However, the chances of it ever being merged are low, as the repository no longer appears to be actively maintained. **Proposal** Use the patched package and import it via an "ugly" github link. This should push us toward eventually migrating to another validation library such as Zod.
|
Great idea @rdubigny, have you maybe thought of a way to exclude parent validator from being used? Or anything like that maybe? |
Hello @Setitch, In this PR, I focused solely on updating #748 without trying to introduce any new changes. That said, I’m not convinced this is a good idea. In TypeScript, inheritance follows the Liskov Substitution Principle, which states:
If a parent class defines |
Description
This is an updated rebase of #748 .
Fixes a bug that caused decorated properties which are also decorated in inherited classes, to skip their inherited validation.
Checklist
Fixes
fixes #633 , fixes #622