{"action":"created","issue":{"url":"https://api.github.com/repos/Vincit/objection.js/issues/549","repository_url":"https://api.github.com/repos/Vincit/objection.js","labels_url":"https://api.github.com/repos/Vincit/objection.js/issues/549/labels{/name}","comments_url":"https://api.github.com/repos/Vincit/objection.js/issues/549/comments","events_url":"https://api.github.com/repos/Vincit/objection.js/issues/549/events","html_url":"https://github.com/Vincit/objection.js/issues/549","id":264535630,"number":549,"title":"Shared Validator","user":{"login":"lehni","id":213275,"avatar_url":"https://avatars3.githubusercontent.com/u/213275?v=4","gravatar_id":"","url":"https://api.github.com/users/lehni","html_url":"https://github.com/lehni","followers_url":"https://api.github.com/users/lehni/followers","following_url":"https://api.github.com/users/lehni/following{/other_user}","gists_url":"https://api.github.com/users/lehni/gists{/gist_id}","starred_url":"https://api.github.com/users/lehni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lehni/subscriptions","organizations_url":"https://api.github.com/users/lehni/orgs","repos_url":"https://api.github.com/users/lehni/repos","events_url":"https://api.github.com/users/lehni/events{/privacy}","received_events_url":"https://api.github.com/users/lehni/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-10-11T10:32:20Z","updated_at":"2017-10-15T21:47:36Z","closed_at":"2017-10-12T14:30:13Z","author_association":"CONTRIBUTOR","body":"Is there a reason why a separate validator object is created for each model through `createValidator()`?\r\n\r\nHaving a shared AJV validator across all models would offer a few benefits:\r\n\r\n* Additional keywords and formats could be registered and used across all JSON schemas, see http://epoberezkin.github.io/ajv/custom.html\r\n* Definitions could be easily shared and referenced through `$ref`\r\n\r\nI can already achieve this by returning the same instance in each model's static `createValidator()` method, but I think it's worth considering making this easier."},"comment":{"url":"https://api.github.com/repos/Vincit/objection.js/issues/comments/336744053","html_url":"https://github.com/Vincit/objection.js/issues/549#issuecomment-336744053","issue_url":"https://api.github.com/repos/Vincit/objection.js/issues/549","id":336744053,"user":{"login":"jordansexton","id":1173161,"avatar_url":"https://avatars2.githubusercontent.com/u/1173161?v=4","gravatar_id":"","url":"https://api.github.com/users/jordansexton","html_url":"https://github.com/jordansexton","followers_url":"https://api.github.com/users/jordansexton/followers","following_url":"https://api.github.com/users/jordansexton/following{/other_user}","gists_url":"https://api.github.com/users/jordansexton/gists{/gist_id}","starred_url":"https://api.github.com/users/jordansexton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordansexton/subscriptions","organizations_url":"https://api.github.com/users/jordansexton/orgs","repos_url":"https://api.github.com/users/jordansexton/repos","events_url":"https://api.github.com/users/jordansexton/events{/privacy}","received_events_url":"https://api.github.com/users/jordansexton/received_events","type":"User","site_admin":false},"created_at":"2017-10-15T21:47:36Z","updated_at":"2017-10-15T21:47:36Z","author_association":"CONTRIBUTOR","body":"@lehni This is interesting, how do you get both model schemas to compile with the same validator such that the references resolve?"}}
{"actor":{"display_login":"jordansexton"}}