onehilltech/blueprint

Direct support for validation schemas

hilljh82 opened this issue · 0 comments

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
    }
}