-
Notifications
You must be signed in to change notification settings - Fork 787
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
feature: Support CIDR notation in IsIP validator #727
Labels
type: feature
Issues related to new features.
Comments
Hi, we use validator.js internally and they seem to have a It only support ipv4 so you would also have to open an issue there to ask a feature request for IPv6 range |
AnandChowdhary
added a commit
to AnandChowdhary/class-validator
that referenced
this issue
Jan 1, 2021
AnandChowdhary
added a commit
to AnandChowdhary/class-validator
that referenced
this issue
Jan 1, 2021
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Currently the IP validation fails when a IP subnet using CIDR notation is given.
Example values
Proposed solution
Add an additional argument to the IsIP validator specifying whether CIDR notation is required, optional or forbidden. Default the argument to forbidden to maintain backwards compatibility.
Optionally the CIDR prefix could be validated. It can only have value 0-32 for IPv4 or 0-128 for IPv6
The text was updated successfully, but these errors were encountered: