{"action":"created","comment":{"url":"https://api.github.com/repos/folio-org/raml-module-builder/pulls/comments/179960335","pull_request_review_id":110299258,"id":179960335,"diff_hunk":"@@ -83,4 +106,111 @@ public void onAddResourceMethod(JMethod method, Action action, MimeType bodyMime\n \n   }\n \n+  private static void handleOverrides() throws IOException {\n+    String overrides = null;\n+    if(overrideFileExists){\n+      overrides = IOUtils.toString(Raml2Java.class.getClassLoader().getResourceAsStream(\n+        \"overrides/raml_overrides.json\"), \"UTF-8\");\n+      if(overrides == null){\n+        log.info(\"No overrides/raml_overrides.json file found, continuing...\");\n+        overrideFileExists = false;\n+        return;\n+      }\n+    }\n+    else{\n+      return;\n+    }\n+    if(overrideMap.isEmpty()){\n+      try {\n+        JsonObject jobj = new JsonObject(overrides);\n+        JsonArray jar = jobj.getJsonArray(\"overrides\");\n+        int size = jar.size();\n+        for (int i = 0; i < size; i++) {\n+          JsonObject overrideEntry = jar.getJsonObject(i);\n+          String type = overrideEntry.getString(\"type\");\n+          String url = overrideEntry.getString(\"url\");\n+          overrideMap.put(url, type, overrideEntry);\n+        }\n+      } catch (Exception e1) {\n+        log.error(e1.getMessage(), e1);\n+      }\n+    }\n+  }\n+\n+  private void generateOverrides(JMethod method, Action action){\n+    //check if url has a param / params associated with it that needs overriding\n+    Map<String,JsonObject> overrideEntry = overrideMap.row(action.getResource().getUri());\n+    if(overrideEntry != null){\n+      //this endpoint was found in the config file and has an override associated with one of\n+      //its parameters\n+      JVar[] params = method.listParams();\n+      int []i = new int[]{0};\n+      for (i[0] = 0; i[0] < params.length; i[0]++) {\n+        Set<Entry<String, JsonObject>> entries = overrideEntry.entrySet();\n+        entries.forEach( entry -> {\n+          //iterate through the params of the generated function for this url + verb and look\n+          //for the parameter whose annotation we need to override\n+          JsonObject job = entry.getValue();\n+          String type = job.getString(\"type\");\n+          Object value = job.getValue(\"value\");\n+          String paramName = job.getString(\"paramName\");\n+          if(!action.getResource().getUri().equalsIgnoreCase(job.getString(\"verb\"))){\n+            //make sure the verb is aligned\n+            JAnnotationUse ann[] = new JAnnotationUse[]{null};","path":"domain-models-interface-extensions/src/main/java/org/folio/rest/tools/Raml2Java.java","position":108,"original_position":108,"commit_id":"64cb771f1ca3be51763ca2b9ef40296f2b2e1b79","original_commit_id":"64cb771f1ca3be51763ca2b9ef40296f2b2e1b79","user":{"login":"id-jenkins","id":16718781,"avatar_url":"https://avatars0.githubusercontent.com/u/16718781?v=4","gravatar_id":"","url":"https://api.github.com/users/id-jenkins","html_url":"https://github.com/id-jenkins","followers_url":"https://api.github.com/users/id-jenkins/followers","following_url":"https://api.github.com/users/id-jenkins/following{/other_user}","gists_url":"https://api.github.com/users/id-jenkins/gists{/gist_id}","starred_url":"https://api.github.com/users/id-jenkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/id-jenkins/subscriptions","organizations_url":"https://api.github.com/users/id-jenkins/orgs","repos_url":"https://api.github.com/users/id-jenkins/repos","events_url":"https://api.github.com/users/id-jenkins/events{/privacy}","received_events_url":"https://api.github.com/users/id-jenkins/received_events","type":"User","site_admin":false},"body":"![MINOR](https://sonarsource.github.io/sonar-github/severity-minor.png 'Severity: MINOR') Move the array designator from the variable to the type. [![rule](https://sonarsource.github.io/sonar-github/rule.png)](https://sonarcloud.io/coding_rules#rule_key=squid%3AS1197)\n","created_at":"2018-04-08T20:31:14Z","updated_at":"2018-04-08T20:31:14Z","html_url":"https://github.com/folio-org/raml-module-builder/pull/190#discussion_r179960335","pull_request_url":"https://api.github.com/repos/folio-org/raml-module-builder/pulls/190","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/folio-org/raml-module-builder/pulls/comments/179960335"},"html":{"href":"https://github.com/folio-org/raml-module-builder/pull/190#discussion_r179960335"},"pull_request":{"href":"https://api.github.com/repos/folio-org/raml-module-builder/pulls/190"}}},"pull_request":{"url":"https://api.github.com/repos/folio-org/raml-module-builder/pulls/190","id":178813204,"html_url":"https://github.com/folio-org/raml-module-builder/pull/190","diff_url":"https://github.com/folio-org/raml-module-builder/pull/190.diff","patch_url":"https://github.com/folio-org/raml-module-builder/pull/190.patch","issue_url":"https://api.github.com/repos/folio-org/raml-module-builder/issues/190","number":190,"state":"open","locked":false,"title":"V19.0.2 p2","user":{"login":"shale99","id":10080673,"avatar_url":"https://avatars1.githubusercontent.com/u/10080673?v=4","gravatar_id":"","url":"https://api.github.com/users/shale99","html_url":"https://github.com/shale99","followers_url":"https://api.github.com/users/shale99/followers","following_url":"https://api.github.com/users/shale99/following{/other_user}","gists_url":"https://api.github.com/users/shale99/gists{/gist_id}","starred_url":"https://api.github.com/users/shale99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shale99/subscriptions","organizations_url":"https://api.github.com/users/shale99/orgs","repos_url":"https://api.github.com/users/shale99/repos","events_url":"https://api.github.com/users/shale99/events{/privacy}","received_events_url":"https://api.github.com/users/shale99/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-02T10:20:08Z","updated_at":"2018-04-08T20:31:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"695b457bd88c1539db7bd8dc512ec64c63f05960","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/folio-org/raml-module-builder/pulls/190/commits","review_comments_url":"https://api.github.com/repos/folio-org/raml-module-builder/pulls/190/comments","review_comment_url":"https://api.github.com/repos/folio-org/raml-module-builder/pulls/comments{/number}","comments_url":"https://api.github.com/repos/folio-org/raml-module-builder/issues/190/comments","statuses_url":"https://api.github.com/repos/folio-org/raml-module-builder/statuses/64cb771f1ca3be51763ca2b9ef40296f2b2e1b79","head":{"label":"folio-org:v19.0.2_p2","ref":"v19.0.2_p2","sha":"64cb771f1ca3be51763ca2b9ef40296f2b2e1b79","user":{"login":"folio-org","id":16495055,"avatar_url":"https://avatars2.githubusercontent.com/u/16495055?v=4","gravatar_id":"","url":"https://api.github.com/users/folio-org","html_url":"https://github.com/folio-org","followers_url":"https://api.github.com/users/folio-org/followers","following_url":"https://api.github.com/users/folio-org/following{/other_user}","gists_url":"https://api.github.com/users/folio-org/gists{/gist_id}","starred_url":"https://api.github.com/users/folio-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/folio-org/subscriptions","organizations_url":"https://api.github.com/users/folio-org/orgs","repos_url":"https://api.github.com/users/folio-org/repos","events_url":"https://api.github.com/users/folio-org/events{/privacy}","received_events_url":"https://api.github.com/users/folio-org/received_events","type":"Organization","site_admin":false},"repo":{"id":65975333,"name":"raml-module-builder","full_name":"folio-org/raml-module-builder","owner":{"login":"folio-org","id":16495055,"avatar_url":"https://avatars2.githubusercontent.com/u/16495055?v=4","gravatar_id":"","url":"https://api.github.com/users/folio-org","html_url":"https://github.com/folio-org","followers_url":"https://api.github.com/users/folio-org/followers","following_url":"https://api.github.com/users/folio-org/following{/other_user}","gists_url":"https://api.github.com/users/folio-org/gists{/gist_id}","starred_url":"https://api.github.com/users/folio-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/folio-org/subscriptions","organizations_url":"https://api.github.com/users/folio-org/orgs","repos_url":"https://api.github.com/users/folio-org/repos","events_url":"https://api.github.com/users/folio-org/events{/privacy}","received_events_url":"https://api.github.com/users/folio-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/folio-org/raml-module-builder","description":"framework allowing easy module creation based on raml files","fork":false,"url":"https://api.github.com/repos/folio-org/raml-module-builder","forks_url":"https://api.github.com/repos/folio-org/raml-module-builder/forks","keys_url":"https://api.github.com/repos/folio-org/raml-module-builder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/folio-org/raml-module-builder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/folio-org/raml-module-builder/teams","hooks_url":"https://api.github.com/repos/folio-org/raml-module-builder/hooks","issue_events_url":"https://api.github.com/repos/folio-org/raml-module-builder/issues/events{/number}","events_url":"https://api.github.com/repos/folio-org/raml-module-builder/events","assignees_url":"https://api.github.com/repos/folio-org/raml-module-builder/assignees{/user}","branches_url":"https://api.github.com/repos/folio-org/raml-module-builder/branches{/branch}","tags_url":"https://api.github.com/repos/folio-org/raml-module-builder/tags","blobs_url":"https://api.github.com/repos/folio-org/raml-module-builder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/folio-org/raml-module-builder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/folio-org/raml-module-builder/git/refs{/sha}","trees_url":"https://api.github.com/repos/folio-org/raml-module-builder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/folio-org/raml-module-builder/statuses/{sha}","languages_url":"https://api.github.com/repos/folio-org/raml-module-builder/languages","stargazers_url":"https://api.github.com/repos/folio-org/raml-module-builder/stargazers","contributors_url":"https://api.github.com/repos/folio-org/raml-module-builder/contributors","subscribers_url":"https://api.github.com/repos/folio-org/raml-module-builder/subscribers","subscription_url":"https://api.github.com/repos/folio-org/raml-module-builder/subscription","commits_url":"https://api.github.com/repos/folio-org/raml-module-builder/commits{/sha}","git_commits_url":"https://api.github.com/repos/folio-org/raml-module-builder/git/commits{/sha}","comments_url":"https://api.github.com/repos/folio-org/raml-module-builder/comments{/number}","issue_comment_url":"https://api.github.com/repos/folio-org/raml-module-builder/issues/comments{/number}","contents_url":"https://api.github.com/repos/folio-org/raml-module-builder/contents/{+path}","compare_url":"https://api.github.com/repos/folio-org/raml-module-builder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/folio-org/raml-module-builder/merges","archive_url":"https://api.github.com/repos/folio-org/raml-module-builder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/folio-org/raml-module-builder/downloads","issues_url":"https://api.github.com/repos/folio-org/raml-module-builder/issues{/number}","pulls_url":"https://api.github.com/repos/folio-org/raml-module-builder/pulls{/number}","milestones_url":"https://api.github.com/repos/folio-org/raml-module-builder/milestones{/number}","notifications_url":"https://api.github.com/repos/folio-org/raml-module-builder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/folio-org/raml-module-builder/labels{/name}","releases_url":"https://api.github.com/repos/folio-org/raml-module-builder/releases{/id}","deployments_url":"https://api.github.com/repos/folio-org/raml-module-builder/deployments","created_at":"2016-08-18T07:28:13Z","updated_at":"2018-04-02T08:37:21Z","pushed_at":"2018-04-08T20:26:44Z","git_url":"git://github.com/folio-org/raml-module-builder.git","ssh_url":"git@github.com:folio-org/raml-module-builder.git","clone_url":"https://github.com/folio-org/raml-module-builder.git","svn_url":"https://github.com/folio-org/raml-module-builder","homepage":null,"size":4162,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":5,"open_issues":3,"watchers":6,"default_branch":"master"}},"base":{"label":"folio-org:master","ref":"master","sha":"4fbe4ee851dfd34ee640fc509d1ae2cfa7b9e6ae","user":{"login":"folio-org","id":16495055,"avatar_url":"https://avatars2.githubusercontent.com/u/16495055?v=4","gravatar_id":"","url":"https://api.github.com/users/folio-org","html_url":"https://github.com/folio-org","followers_url":"https://api.github.com/users/folio-org/followers","following_url":"https://api.github.com/users/folio-org/following{/other_user}","gists_url":"https://api.github.com/users/folio-org/gists{/gist_id}","starred_url":"https://api.github.com/users/folio-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/folio-org/subscriptions","organizations_url":"https://api.github.com/users/folio-org/orgs","repos_url":"https://api.github.com/users/folio-org/repos","events_url":"https://api.github.com/users/folio-org/events{/privacy}","received_events_url":"https://api.github.com/users/folio-org/received_events","type":"Organization","site_admin":false},"repo":{"id":65975333,"name":"raml-module-builder","full_name":"folio-org/raml-module-builder","owner":{"login":"folio-org","id":16495055,"avatar_url":"https://avatars2.githubusercontent.com/u/16495055?v=4","gravatar_id":"","url":"https://api.github.com/users/folio-org","html_url":"https://github.com/folio-org","followers_url":"https://api.github.com/users/folio-org/followers","following_url":"https://api.github.com/users/folio-org/following{/other_user}","gists_url":"https://api.github.com/users/folio-org/gists{/gist_id}","starred_url":"https://api.github.com/users/folio-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/folio-org/subscriptions","organizations_url":"https://api.github.com/users/folio-org/orgs","repos_url":"https://api.github.com/users/folio-org/repos","events_url":"https://api.github.com/users/folio-org/events{/privacy}","received_events_url":"https://api.github.com/users/folio-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/folio-org/raml-module-builder","description":"framework allowing easy module creation based on raml files","fork":false,"url":"https://api.github.com/repos/folio-org/raml-module-builder","forks_url":"https://api.github.com/repos/folio-org/raml-module-builder/forks","keys_url":"https://api.github.com/repos/folio-org/raml-module-builder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/folio-org/raml-module-builder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/folio-org/raml-module-builder/teams","hooks_url":"https://api.github.com/repos/folio-org/raml-module-builder/hooks","issue_events_url":"https://api.github.com/repos/folio-org/raml-module-builder/issues/events{/number}","events_url":"https://api.github.com/repos/folio-org/raml-module-builder/events","assignees_url":"https://api.github.com/repos/folio-org/raml-module-builder/assignees{/user}","branches_url":"https://api.github.com/repos/folio-org/raml-module-builder/branches{/branch}","tags_url":"https://api.github.com/repos/folio-org/raml-module-builder/tags","blobs_url":"https://api.github.com/repos/folio-org/raml-module-builder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/folio-org/raml-module-builder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/folio-org/raml-module-builder/git/refs{/sha}","trees_url":"https://api.github.com/repos/folio-org/raml-module-builder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/folio-org/raml-module-builder/statuses/{sha}","languages_url":"https://api.github.com/repos/folio-org/raml-module-builder/languages","stargazers_url":"https://api.github.com/repos/folio-org/raml-module-builder/stargazers","contributors_url":"https://api.github.com/repos/folio-org/raml-module-builder/contributors","subscribers_url":"https://api.github.com/repos/folio-org/raml-module-builder/subscribers","subscription_url":"https://api.github.com/repos/folio-org/raml-module-builder/subscription","commits_url":"https://api.github.com/repos/folio-org/raml-module-builder/commits{/sha}","git_commits_url":"https://api.github.com/repos/folio-org/raml-module-builder/git/commits{/sha}","comments_url":"https://api.github.com/repos/folio-org/raml-module-builder/comments{/number}","issue_comment_url":"https://api.github.com/repos/folio-org/raml-module-builder/issues/comments{/number}","contents_url":"https://api.github.com/repos/folio-org/raml-module-builder/contents/{+path}","compare_url":"https://api.github.com/repos/folio-org/raml-module-builder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/folio-org/raml-module-builder/merges","archive_url":"https://api.github.com/repos/folio-org/raml-module-builder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/folio-org/raml-module-builder/downloads","issues_url":"https://api.github.com/repos/folio-org/raml-module-builder/issues{/number}","pulls_url":"https://api.github.com/repos/folio-org/raml-module-builder/pulls{/number}","milestones_url":"https://api.github.com/repos/folio-org/raml-module-builder/milestones{/number}","notifications_url":"https://api.github.com/repos/folio-org/raml-module-builder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/folio-org/raml-module-builder/labels{/name}","releases_url":"https://api.github.com/repos/folio-org/raml-module-builder/releases{/id}","deployments_url":"https://api.github.com/repos/folio-org/raml-module-builder/deployments","created_at":"2016-08-18T07:28:13Z","updated_at":"2018-04-02T08:37:21Z","pushed_at":"2018-04-08T20:26:44Z","git_url":"git://github.com/folio-org/raml-module-builder.git","ssh_url":"git@github.com:folio-org/raml-module-builder.git","clone_url":"https://github.com/folio-org/raml-module-builder.git","svn_url":"https://github.com/folio-org/raml-module-builder","homepage":null,"size":4162,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":5,"open_issues":3,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/folio-org/raml-module-builder/pulls/190"},"html":{"href":"https://github.com/folio-org/raml-module-builder/pull/190"},"issue":{"href":"https://api.github.com/repos/folio-org/raml-module-builder/issues/190"},"comments":{"href":"https://api.github.com/repos/folio-org/raml-module-builder/issues/190/comments"},"review_comments":{"href":"https://api.github.com/repos/folio-org/raml-module-builder/pulls/190/comments"},"review_comment":{"href":"https://api.github.com/repos/folio-org/raml-module-builder/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/folio-org/raml-module-builder/pulls/190/commits"},"statuses":{"href":"https://api.github.com/repos/folio-org/raml-module-builder/statuses/64cb771f1ca3be51763ca2b9ef40296f2b2e1b79"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"id-jenkins"}}