class-validator
class-validator copied to clipboard
How can get a property validators?
I am making a library which integrates with class-validator
I need to check if the property has the validator @IsOptional() or not to use the answer in an IF condition?
Is that possible?
This should be possible, yes.
Study the code in these folders to learn more:
- https://github.com/typestack/class-validator/tree/develop/src/validation
- https://github.com/typestack/class-validator/tree/develop/src/metadata
Closing this as solved.
If the issue still persists, you may open a new Q&A in the discussions tab and someone from the community may be able to help.
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.