{"action":"created","comment":{"url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/pulls/comments/220983544","pull_request_review_id":159517501,"id":220983544,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDk4MzU0NA==","diff_hunk":"@@ -25,6 +32,15 @@ public CompanyAccountsWebApplication(UserDetailsInterceptor userDetailsIntercept\n     }\n \n     public static void main(String[] args) {\n+\n+        try {\n+            ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(true);\n+            ValidationHelper.scanPackageForValidationMappings(provider, APPLICATION_MODEL_PACKAGE);","path":"src/main/java/uk/gov/companieshouse/web/accounts/CompanyAccountsWebApplication.java","position":30,"original_position":30,"commit_id":"846186c399c6b71b6536e40dc0854eaf86e7b7c2","original_commit_id":"846186c399c6b71b6536e40dc0854eaf86e7b7c2","user":{"login":"jterrych","id":29060322,"node_id":"MDQ6VXNlcjI5MDYwMzIy","avatar_url":"https://avatars2.githubusercontent.com/u/29060322?v=4","gravatar_id":"","url":"https://api.github.com/users/jterrych","html_url":"https://github.com/jterrych","followers_url":"https://api.github.com/users/jterrych/followers","following_url":"https://api.github.com/users/jterrych/following{/other_user}","gists_url":"https://api.github.com/users/jterrych/gists{/gist_id}","starred_url":"https://api.github.com/users/jterrych/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jterrych/subscriptions","organizations_url":"https://api.github.com/users/jterrych/orgs","repos_url":"https://api.github.com/users/jterrych/repos","events_url":"https://api.github.com/users/jterrych/events{/privacy}","received_events_url":"https://api.github.com/users/jterrych/received_events","type":"User","site_admin":false},"body":"This is a Spring component and shouldnt need and static methods to make it to work, the act of spring injecting the bean should be enough for it to do everything thats required. perhaps the static methods should be instance methods instead and the scan scanPackageForValidationMappings be called witihn the constructor?","created_at":"2018-09-27T16:03:55Z","updated_at":"2018-09-27T16:20:10Z","html_url":"https://github.com/companieshouse/company-accounts.web.ch.gov.uk/pull/77#discussion_r220983544","pull_request_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/pulls/77","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/pulls/comments/220983544"},"html":{"href":"https://github.com/companieshouse/company-accounts.web.ch.gov.uk/pull/77#discussion_r220983544"},"pull_request":{"href":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/pulls/77"}}},"pull_request":{"url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/pulls/77","id":218629536,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE4NjI5NTM2","html_url":"https://github.com/companieshouse/company-accounts.web.ch.gov.uk/pull/77","diff_url":"https://github.com/companieshouse/company-accounts.web.ch.gov.uk/pull/77.diff","patch_url":"https://github.com/companieshouse/company-accounts.web.ch.gov.uk/pull/77.patch","issue_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/issues/77","number":77,"state":"open","locked":false,"title":"Add API validation error support","user":{"login":"marcransome","id":679401,"node_id":"MDQ6VXNlcjY3OTQwMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/679401?v=4","gravatar_id":"","url":"https://api.github.com/users/marcransome","html_url":"https://github.com/marcransome","followers_url":"https://api.github.com/users/marcransome/followers","following_url":"https://api.github.com/users/marcransome/following{/other_user}","gists_url":"https://api.github.com/users/marcransome/gists{/gist_id}","starred_url":"https://api.github.com/users/marcransome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcransome/subscriptions","organizations_url":"https://api.github.com/users/marcransome/orgs","repos_url":"https://api.github.com/users/marcransome/repos","events_url":"https://api.github.com/users/marcransome/events{/privacy}","received_events_url":"https://api.github.com/users/marcransome/received_events","type":"User","site_admin":false},"body":"These changes introduce a number of custom annotations—namely `ValidationModel` and `ValidationMapping`—to support dynamic binding of API validation errors to model object fields.\r\n\r\nThe process works as follows:\r\n\r\n- On application startup the models package is scanned for model classes annotated with `@ValidationModel`\r\n- For each candidate class, the declared fields are scanned for `@ValidationMapping` annotations; primitive or `String` fields _without_ the annotation are ignored, other fields become candidates themselves for the same class scanning mechanism\r\n- For each `@ValidationMapping` annotation, a mapping is created for the field name (introspected) and the full JSON error path taken from the annotation\r\n- At runtime, API validation errors are mapped to fields using the `ValidationHelper` class, and a support method added to the `BaseController` class\r\n\r\nSignificant classes and methods—both `public` and `private`—include Javadoc comments with explanatory notes on their function.\r\n\r\nResolves: SFA-706","created_at":"2018-09-27T12:14:36Z","updated_at":"2018-09-27T16:20:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"98fa5bb1a8e8866bc1c30cacd8eb379620d75562","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/pulls/77/commits","review_comments_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/pulls/77/comments","review_comment_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/issues/77/comments","statuses_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/statuses/846186c399c6b71b6536e40dc0854eaf86e7b7c2","head":{"label":"companieshouse:feature/add-api-validation-support","ref":"feature/add-api-validation-support","sha":"846186c399c6b71b6536e40dc0854eaf86e7b7c2","user":{"login":"companieshouse","id":4947323,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5NDczMjM=","avatar_url":"https://avatars0.githubusercontent.com/u/4947323?v=4","gravatar_id":"","url":"https://api.github.com/users/companieshouse","html_url":"https://github.com/companieshouse","followers_url":"https://api.github.com/users/companieshouse/followers","following_url":"https://api.github.com/users/companieshouse/following{/other_user}","gists_url":"https://api.github.com/users/companieshouse/gists{/gist_id}","starred_url":"https://api.github.com/users/companieshouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/companieshouse/subscriptions","organizations_url":"https://api.github.com/users/companieshouse/orgs","repos_url":"https://api.github.com/users/companieshouse/repos","events_url":"https://api.github.com/users/companieshouse/events{/privacy}","received_events_url":"https://api.github.com/users/companieshouse/received_events","type":"Organization","site_admin":false},"repo":{"id":137176488,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcxNzY0ODg=","name":"company-accounts.web.ch.gov.uk","full_name":"companieshouse/company-accounts.web.ch.gov.uk","private":false,"owner":{"login":"companieshouse","id":4947323,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5NDczMjM=","avatar_url":"https://avatars0.githubusercontent.com/u/4947323?v=4","gravatar_id":"","url":"https://api.github.com/users/companieshouse","html_url":"https://github.com/companieshouse","followers_url":"https://api.github.com/users/companieshouse/followers","following_url":"https://api.github.com/users/companieshouse/following{/other_user}","gists_url":"https://api.github.com/users/companieshouse/gists{/gist_id}","starred_url":"https://api.github.com/users/companieshouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/companieshouse/subscriptions","organizations_url":"https://api.github.com/users/companieshouse/orgs","repos_url":"https://api.github.com/users/companieshouse/repos","events_url":"https://api.github.com/users/companieshouse/events{/privacy}","received_events_url":"https://api.github.com/users/companieshouse/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/companieshouse/company-accounts.web.ch.gov.uk","description":"The Companies House web application for handling company accounts","fork":false,"url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk","forks_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/forks","keys_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/teams","hooks_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/hooks","issue_events_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/issues/events{/number}","events_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/events","assignees_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/assignees{/user}","branches_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/branches{/branch}","tags_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/tags","blobs_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/git/refs{/sha}","trees_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/statuses/{sha}","languages_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/languages","stargazers_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/stargazers","contributors_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/contributors","subscribers_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/subscribers","subscription_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/subscription","commits_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/commits{/sha}","git_commits_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/git/commits{/sha}","comments_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/comments{/number}","issue_comment_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/issues/comments{/number}","contents_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/contents/{+path}","compare_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/merges","archive_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/downloads","issues_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/issues{/number}","pulls_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/pulls{/number}","milestones_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/milestones{/number}","notifications_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/labels{/name}","releases_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/releases{/id}","deployments_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/deployments","created_at":"2018-06-13T07:07:53Z","updated_at":"2018-09-27T12:11:22Z","pushed_at":"2018-09-27T12:31:44Z","git_url":"git://github.com/companieshouse/company-accounts.web.ch.gov.uk.git","ssh_url":"git@github.com:companieshouse/company-accounts.web.ch.gov.uk.git","clone_url":"https://github.com/companieshouse/company-accounts.web.ch.gov.uk.git","svn_url":"https://github.com/companieshouse/company-accounts.web.ch.gov.uk","homepage":null,"size":455,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"base":{"label":"companieshouse:develop","ref":"develop","sha":"b190a1de5be1ce37b90f26833be079f32af86c17","user":{"login":"companieshouse","id":4947323,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5NDczMjM=","avatar_url":"https://avatars0.githubusercontent.com/u/4947323?v=4","gravatar_id":"","url":"https://api.github.com/users/companieshouse","html_url":"https://github.com/companieshouse","followers_url":"https://api.github.com/users/companieshouse/followers","following_url":"https://api.github.com/users/companieshouse/following{/other_user}","gists_url":"https://api.github.com/users/companieshouse/gists{/gist_id}","starred_url":"https://api.github.com/users/companieshouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/companieshouse/subscriptions","organizations_url":"https://api.github.com/users/companieshouse/orgs","repos_url":"https://api.github.com/users/companieshouse/repos","events_url":"https://api.github.com/users/companieshouse/events{/privacy}","received_events_url":"https://api.github.com/users/companieshouse/received_events","type":"Organization","site_admin":false},"repo":{"id":137176488,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcxNzY0ODg=","name":"company-accounts.web.ch.gov.uk","full_name":"companieshouse/company-accounts.web.ch.gov.uk","private":false,"owner":{"login":"companieshouse","id":4947323,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5NDczMjM=","avatar_url":"https://avatars0.githubusercontent.com/u/4947323?v=4","gravatar_id":"","url":"https://api.github.com/users/companieshouse","html_url":"https://github.com/companieshouse","followers_url":"https://api.github.com/users/companieshouse/followers","following_url":"https://api.github.com/users/companieshouse/following{/other_user}","gists_url":"https://api.github.com/users/companieshouse/gists{/gist_id}","starred_url":"https://api.github.com/users/companieshouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/companieshouse/subscriptions","organizations_url":"https://api.github.com/users/companieshouse/orgs","repos_url":"https://api.github.com/users/companieshouse/repos","events_url":"https://api.github.com/users/companieshouse/events{/privacy}","received_events_url":"https://api.github.com/users/companieshouse/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/companieshouse/company-accounts.web.ch.gov.uk","description":"The Companies House web application for handling company accounts","fork":false,"url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk","forks_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/forks","keys_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/teams","hooks_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/hooks","issue_events_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/issues/events{/number}","events_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/events","assignees_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/assignees{/user}","branches_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/branches{/branch}","tags_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/tags","blobs_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/git/refs{/sha}","trees_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/statuses/{sha}","languages_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/languages","stargazers_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/stargazers","contributors_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/contributors","subscribers_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/subscribers","subscription_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/subscription","commits_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/commits{/sha}","git_commits_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/git/commits{/sha}","comments_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/comments{/number}","issue_comment_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/issues/comments{/number}","contents_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/contents/{+path}","compare_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/merges","archive_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/downloads","issues_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/issues{/number}","pulls_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/pulls{/number}","milestones_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/milestones{/number}","notifications_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/labels{/name}","releases_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/releases{/id}","deployments_url":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/deployments","created_at":"2018-06-13T07:07:53Z","updated_at":"2018-09-27T12:11:22Z","pushed_at":"2018-09-27T12:31:44Z","git_url":"git://github.com/companieshouse/company-accounts.web.ch.gov.uk.git","ssh_url":"git@github.com:companieshouse/company-accounts.web.ch.gov.uk.git","clone_url":"https://github.com/companieshouse/company-accounts.web.ch.gov.uk.git","svn_url":"https://github.com/companieshouse/company-accounts.web.ch.gov.uk","homepage":null,"size":455,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/pulls/77"},"html":{"href":"https://github.com/companieshouse/company-accounts.web.ch.gov.uk/pull/77"},"issue":{"href":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/issues/77"},"comments":{"href":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/issues/77/comments"},"review_comments":{"href":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/pulls/77/comments"},"review_comment":{"href":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/pulls/77/commits"},"statuses":{"href":"https://api.github.com/repos/companieshouse/company-accounts.web.ch.gov.uk/statuses/846186c399c6b71b6536e40dc0854eaf86e7b7c2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jterrych"}}