The validation property on the object returned from a controller method is assumed to be a function. There are times when the validation is to only use a schema from express-validator. Unfortunately, to do some requires writing the same one-liner function. It would be nice to either provide a validation function or schema to the validate property. Something like this:
MyController.prototype.someMethod = function () {
return {
validate: {
// add validation schema here
}
}
The
validation
property on the object returned from a controller method is assumed to be a function. There are times when the validation is to only use a schema from express-validator. Unfortunately, to do some requires writing the same one-liner function. It would be nice to either provide a validation function or schema to thevalidate
property. Something like this: