node-restify-validation
node-restify-validation copied to clipboard
String min and max length
This is one of the most popular use cases to make sure people dont put names, etc. as an empty string or 1 character.
eg:
{
name: {
isRequired: true,
minLength: 3,
maxLength: 100
}
}
Thanks,
You case use a regular expression for that :
/.{3,100}/g
Any news on this? It says its possible using min
and max
but still not working for me
Thanks,
Using max only also doesn't work for me, as in:
{ fbName: { isRequired: true, max: 50 } }