{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback/issues/1226","labels_url":"https://api.github.com/repos/strongloop/loopback/issues/1226/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback/issues/1226/comments","events_url":"https://api.github.com/repos/strongloop/loopback/issues/1226/events","html_url":"https://github.com/strongloop/loopback/issues/1226","id":62786401,"number":1226,"title":"afterValidate operation hook","user":{"login":"drish","id":1730156,"avatar_url":"https://avatars.githubusercontent.com/u/1730156?v=3","gravatar_id":"","url":"https://api.github.com/users/drish","html_url":"https://github.com/drish","followers_url":"https://api.github.com/users/drish/followers","following_url":"https://api.github.com/users/drish/following{/other_user}","gists_url":"https://api.github.com/users/drish/gists{/gist_id}","starred_url":"https://api.github.com/users/drish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drish/subscriptions","organizations_url":"https://api.github.com/users/drish/orgs","repos_url":"https://api.github.com/users/drish/repos","events_url":"https://api.github.com/users/drish/events{/privacy}","received_events_url":"https://api.github.com/users/drish/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/strongloop/loopback/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"bajtos","id":1140553,"avatar_url":"https://avatars.githubusercontent.com/u/1140553?v=3","gravatar_id":"","url":"https://api.github.com/users/bajtos","html_url":"https://github.com/bajtos","followers_url":"https://api.github.com/users/bajtos/followers","following_url":"https://api.github.com/users/bajtos/following{/other_user}","gists_url":"https://api.github.com/users/bajtos/gists{/gist_id}","starred_url":"https://api.github.com/users/bajtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajtos/subscriptions","organizations_url":"https://api.github.com/users/bajtos/orgs","repos_url":"https://api.github.com/users/bajtos/repos","events_url":"https://api.github.com/users/bajtos/events{/privacy}","received_events_url":"https://api.github.com/users/bajtos/received_events","type":"User","site_admin":false},"milestone":null,"comments":9,"created_at":"2015-03-18T20:04:38Z","updated_at":"2015-04-01T07:54:28Z","closed_at":null,"body":"Hello guys.\r\n\r\nThe docs say the current version does not support `afterValidate` hook, but what about the case where I need to manipulate data after it is validated ?\r\nFor example, after all my fields are validated I'd like to encrypt some of them and persist into datastore. \r\n\r\nCommon hook `model.afterValidate` is deprecated.\r\n\r\nThanks in advance."},"comment":{"url":"https://api.github.com/repos/strongloop/loopback/issues/comments/88384291","html_url":"https://github.com/strongloop/loopback/issues/1226#issuecomment-88384291","issue_url":"https://api.github.com/repos/strongloop/loopback/issues/1226","id":88384291,"user":{"login":"fabien","id":2749,"avatar_url":"https://avatars.githubusercontent.com/u/2749?v=3","gravatar_id":"","url":"https://api.github.com/users/fabien","html_url":"https://github.com/fabien","followers_url":"https://api.github.com/users/fabien/followers","following_url":"https://api.github.com/users/fabien/following{/other_user}","gists_url":"https://api.github.com/users/fabien/gists{/gist_id}","starred_url":"https://api.github.com/users/fabien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabien/subscriptions","organizations_url":"https://api.github.com/users/fabien/orgs","repos_url":"https://api.github.com/users/fabien/repos","events_url":"https://api.github.com/users/fabien/events{/privacy}","received_events_url":"https://api.github.com/users/fabien/received_events","type":"User","site_admin":false},"created_at":"2015-04-01T07:54:28Z","updated_at":"2015-04-01T07:54:28Z","body":"@bajtos @drish I would propose a lower-level approach using hooks first - over time you could move towards something like #1260 which could be built on top of `afterValidate` (https://github.com/strongloop/loopback-datasource-juggler/pull/545) and `loaded` hooks. With #1260 you cover one specific use-case, I would like to see a more generalized solution."}}