{"action":"closed","issue":{"url":"https://api.github.com/repos/meks77/easy-validation/issues/3","repository_url":"https://api.github.com/repos/meks77/easy-validation","labels_url":"https://api.github.com/repos/meks77/easy-validation/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/meks77/easy-validation/issues/3/comments","events_url":"https://api.github.com/repos/meks77/easy-validation/issues/3/events","html_url":"https://github.com/meks77/easy-validation/issues/3","id":317943552,"number":3,"title":"Enable comfortable ways to provide error codes if a validation fails","user":{"login":"meks77","id":38517613,"avatar_url":"https://avatars0.githubusercontent.com/u/38517613?v=4","gravatar_id":"","url":"https://api.github.com/users/meks77","html_url":"https://github.com/meks77","followers_url":"https://api.github.com/users/meks77/followers","following_url":"https://api.github.com/users/meks77/following{/other_user}","gists_url":"https://api.github.com/users/meks77/gists{/gist_id}","starred_url":"https://api.github.com/users/meks77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meks77/subscriptions","organizations_url":"https://api.github.com/users/meks77/orgs","repos_url":"https://api.github.com/users/meks77/repos","events_url":"https://api.github.com/users/meks77/events{/privacy}","received_events_url":"https://api.github.com/users/meks77/received_events","type":"User","site_admin":false},"labels":[{"id":906789006,"url":"https://api.github.com/repos/meks77/easy-validation/labels/enhancement","name":"enhancement","color":"a2eeef","default":true}],"state":"closed","locked":false,"assignee":{"login":"meks77","id":38517613,"avatar_url":"https://avatars0.githubusercontent.com/u/38517613?v=4","gravatar_id":"","url":"https://api.github.com/users/meks77","html_url":"https://github.com/meks77","followers_url":"https://api.github.com/users/meks77/followers","following_url":"https://api.github.com/users/meks77/following{/other_user}","gists_url":"https://api.github.com/users/meks77/gists{/gist_id}","starred_url":"https://api.github.com/users/meks77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meks77/subscriptions","organizations_url":"https://api.github.com/users/meks77/orgs","repos_url":"https://api.github.com/users/meks77/repos","events_url":"https://api.github.com/users/meks77/events{/privacy}","received_events_url":"https://api.github.com/users/meks77/received_events","type":"User","site_admin":false},"assignees":[{"login":"meks77","id":38517613,"avatar_url":"https://avatars0.githubusercontent.com/u/38517613?v=4","gravatar_id":"","url":"https://api.github.com/users/meks77","html_url":"https://github.com/meks77","followers_url":"https://api.github.com/users/meks77/followers","following_url":"https://api.github.com/users/meks77/following{/other_user}","gists_url":"https://api.github.com/users/meks77/gists{/gist_id}","starred_url":"https://api.github.com/users/meks77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meks77/subscriptions","organizations_url":"https://api.github.com/users/meks77/orgs","repos_url":"https://api.github.com/users/meks77/repos","events_url":"https://api.github.com/users/meks77/events{/privacy}","received_events_url":"https://api.github.com/users/meks77/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-04-26T09:17:34Z","updated_at":"2018-04-30T14:01:23Z","closed_at":"2018-04-30T14:01:23Z","author_association":"OWNER","body":"it should be possible to provide for each single validation a error code\r\n\r\nThis could be done by \r\n1. \"duplicating\" all methods in *Validations and extend them by the argument for the error code\r\n2. setup up a matrix when which error code should be used\r\n3. add the error code to the throwIfInvalid method(what doesn't fulfill the requirement for 100% but maybe in most cases it's enough)\r\n\r\nPoint one leads to a bigger (2 times as big) api because all the validation methods are duplicated. It could be moved to a separate module. But then it's maybe not possible to static import both methods.\r\n\r\nPoint two is a little be complicated to use and  maintain. It is hard to analyse if all necessary mapping are added to the matrix. On the other hand you have a quick overview of all error codes\r\n\r\nPoint three is just for those, who don't need a error code per single validation. If it is good enough to have one error code for more validations wich are joined with \"or\" or \"and\" that's the preferred solution. "}}
{"actor":{"display_login":"meks77"}}