patch(req, next) { // validate the request and clean it var jsonErrors = this.request.validateResource(req); if (!_.isEmpty(jsonErrors)) { return next( jsonErrors, null ); } return next( validate(req.body.data.attributes, patchConstraints), validate.cleanAttributes(req.body.data.attributes, patchConstraints) ); }