{"action":"created","comment":{"url":"https://api.github.com/repos/line/armeria/pulls/comments/183331495","pull_request_review_id":114307923,"id":183331495,"diff_hunk":"@@ -208,6 +217,135 @@ public static Object convertParameter(@Nullable String value,\n                 \"Type '\" + clazz.getSimpleName() + \"' can't be converted.\");\n     }\n \n+    /**\n+     * Returns the value of the {@link Param} annotation which is specified on the {@code element} if\n+     * the value is not blank. If the value is blank, it returns the name of the specified\n+     * {@code element} object which is an instance of {@link Parameter} or {@link Field}.\n+     */\n+    @Nullable\n+    public static String findParamName(AnnotatedElement element) {\n+        return findParamName(element, element);\n+    }\n+\n+    /**\n+     * Returns the value of the {@link Param} annotation which is specified on the {@code element} if\n+     * the value is not blank. If the value is blank, it returns the name of the specified\n+     * {@code nameRetrievalTarget} object which is an instance of {@link Parameter} or {@link Field}.\n+     */\n+    @Nullable\n+    public static String findParamName(AnnotatedElement element, Object nameRetrievalTarget) {\n+        requireNonNull(element, \"element\");\n+        requireNonNull(nameRetrievalTarget, \"nameRetrievalTarget\");\n+        final Param param = element.getAnnotation(Param.class);\n+        if (param == null) {\n+            return null;\n+        }\n+\n+        final String value = param.value();\n+        if (DefaultValues.isSpecified(value)) {\n+            checkArgument(!value.trim().isEmpty(), \"value: %s (expected: not blank)\");","path":"core/src/main/java/com/linecorp/armeria/internal/AnnotatedHttpServiceParamUtil.java","position":74,"original_position":74,"commit_id":"5dabc89b6249ba5ed721d9bae3301db1b8997ed8","original_commit_id":"5dabc89b6249ba5ed721d9bae3301db1b8997ed8","user":{"login":"hyangtack","id":8417787,"avatar_url":"https://avatars1.githubusercontent.com/u/8417787?v=4","gravatar_id":"","url":"https://api.github.com/users/hyangtack","html_url":"https://github.com/hyangtack","followers_url":"https://api.github.com/users/hyangtack/followers","following_url":"https://api.github.com/users/hyangtack/following{/other_user}","gists_url":"https://api.github.com/users/hyangtack/gists{/gist_id}","starred_url":"https://api.github.com/users/hyangtack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyangtack/subscriptions","organizations_url":"https://api.github.com/users/hyangtack/orgs","repos_url":"https://api.github.com/users/hyangtack/repos","events_url":"https://api.github.com/users/hyangtack/events{/privacy}","received_events_url":"https://api.github.com/users/hyangtack/received_events","type":"User","site_admin":false},"body":"Oops! Thanks!","created_at":"2018-04-23T09:38:21Z","updated_at":"2018-04-23T09:38:21Z","html_url":"https://github.com/line/armeria/pull/1147#discussion_r183331495","pull_request_url":"https://api.github.com/repos/line/armeria/pulls/1147","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/line/armeria/pulls/comments/183331495"},"html":{"href":"https://github.com/line/armeria/pull/1147#discussion_r183331495"},"pull_request":{"href":"https://api.github.com/repos/line/armeria/pulls/1147"}},"in_reply_to_id":183324797},"pull_request":{"url":"https://api.github.com/repos/line/armeria/pulls/1147","id":181173765,"html_url":"https://github.com/line/armeria/pull/1147","diff_url":"https://github.com/line/armeria/pull/1147.diff","patch_url":"https://github.com/line/armeria/pull/1147.patch","issue_url":"https://api.github.com/repos/line/armeria/issues/1147","number":1147,"state":"open","locked":false,"title":"Get `@Param` or `@Header` annotation value from a variable if the val…","user":{"login":"hyangtack","id":8417787,"avatar_url":"https://avatars1.githubusercontent.com/u/8417787?v=4","gravatar_id":"","url":"https://api.github.com/users/hyangtack","html_url":"https://github.com/hyangtack","followers_url":"https://api.github.com/users/hyangtack/followers","following_url":"https://api.github.com/users/hyangtack/following{/other_user}","gists_url":"https://api.github.com/users/hyangtack/gists{/gist_id}","starred_url":"https://api.github.com/users/hyangtack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyangtack/subscriptions","organizations_url":"https://api.github.com/users/hyangtack/orgs","repos_url":"https://api.github.com/users/hyangtack/repos","events_url":"https://api.github.com/users/hyangtack/events{/privacy}","received_events_url":"https://api.github.com/users/hyangtack/received_events","type":"User","site_admin":false},"body":"…ue is not specified\r\n\r\nModifications:\r\n- Add `findParamName` and `findHeaderName` to `AnnotatedHttpServiceParamUtil` in order to\r\n  obtain the variable name if a `@Param` or `@Header` annotation does not have a value.\r\n- Refactor `BeanRequestConverterFunction` for cleanup.\r\n- Documentation.\r\n\r\nResult:\r\n- Closes #570","created_at":"2018-04-12T11:36:37Z","updated_at":"2018-04-23T09:38:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3afa0bab3a330eef844d3851738200d21cd02992","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":287373881,"url":"https://api.github.com/repos/line/armeria/labels/new-feature","name":"new-feature","color":"009800","default":false}],"milestone":{"url":"https://api.github.com/repos/line/armeria/milestones/100","html_url":"https://github.com/line/armeria/milestone/100","labels_url":"https://api.github.com/repos/line/armeria/milestones/100/labels","id":3246493,"number":100,"title":"0.63.0","description":"","creator":{"login":"trustin","id":173918,"avatar_url":"https://avatars0.githubusercontent.com/u/173918?v=4","gravatar_id":"","url":"https://api.github.com/users/trustin","html_url":"https://github.com/trustin","followers_url":"https://api.github.com/users/trustin/followers","following_url":"https://api.github.com/users/trustin/following{/other_user}","gists_url":"https://api.github.com/users/trustin/gists{/gist_id}","starred_url":"https://api.github.com/users/trustin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trustin/subscriptions","organizations_url":"https://api.github.com/users/trustin/orgs","repos_url":"https://api.github.com/users/trustin/repos","events_url":"https://api.github.com/users/trustin/events{/privacy}","received_events_url":"https://api.github.com/users/trustin/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":18,"state":"open","created_at":"2018-04-05T23:20:15Z","updated_at":"2018-04-23T09:31:34Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/line/armeria/pulls/1147/commits","review_comments_url":"https://api.github.com/repos/line/armeria/pulls/1147/comments","review_comment_url":"https://api.github.com/repos/line/armeria/pulls/comments{/number}","comments_url":"https://api.github.com/repos/line/armeria/issues/1147/comments","statuses_url":"https://api.github.com/repos/line/armeria/statuses/5dabc89b6249ba5ed721d9bae3301db1b8997ed8","head":{"label":"hyangtack:feature/param_annotation","ref":"feature/param_annotation","sha":"5dabc89b6249ba5ed721d9bae3301db1b8997ed8","user":{"login":"hyangtack","id":8417787,"avatar_url":"https://avatars1.githubusercontent.com/u/8417787?v=4","gravatar_id":"","url":"https://api.github.com/users/hyangtack","html_url":"https://github.com/hyangtack","followers_url":"https://api.github.com/users/hyangtack/followers","following_url":"https://api.github.com/users/hyangtack/following{/other_user}","gists_url":"https://api.github.com/users/hyangtack/gists{/gist_id}","starred_url":"https://api.github.com/users/hyangtack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyangtack/subscriptions","organizations_url":"https://api.github.com/users/hyangtack/orgs","repos_url":"https://api.github.com/users/hyangtack/repos","events_url":"https://api.github.com/users/hyangtack/events{/privacy}","received_events_url":"https://api.github.com/users/hyangtack/received_events","type":"User","site_admin":false},"repo":{"id":48430251,"name":"armeria","full_name":"hyangtack/armeria","owner":{"login":"hyangtack","id":8417787,"avatar_url":"https://avatars1.githubusercontent.com/u/8417787?v=4","gravatar_id":"","url":"https://api.github.com/users/hyangtack","html_url":"https://github.com/hyangtack","followers_url":"https://api.github.com/users/hyangtack/followers","following_url":"https://api.github.com/users/hyangtack/following{/other_user}","gists_url":"https://api.github.com/users/hyangtack/gists{/gist_id}","starred_url":"https://api.github.com/users/hyangtack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyangtack/subscriptions","organizations_url":"https://api.github.com/users/hyangtack/orgs","repos_url":"https://api.github.com/users/hyangtack/repos","events_url":"https://api.github.com/users/hyangtack/events{/privacy}","received_events_url":"https://api.github.com/users/hyangtack/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hyangtack/armeria","description":"Asynchronous RPC/API client/server library built on top of Java 8, Netty 4.1, HTTP/2, and Thrift","fork":true,"url":"https://api.github.com/repos/hyangtack/armeria","forks_url":"https://api.github.com/repos/hyangtack/armeria/forks","keys_url":"https://api.github.com/repos/hyangtack/armeria/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hyangtack/armeria/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hyangtack/armeria/teams","hooks_url":"https://api.github.com/repos/hyangtack/armeria/hooks","issue_events_url":"https://api.github.com/repos/hyangtack/armeria/issues/events{/number}","events_url":"https://api.github.com/repos/hyangtack/armeria/events","assignees_url":"https://api.github.com/repos/hyangtack/armeria/assignees{/user}","branches_url":"https://api.github.com/repos/hyangtack/armeria/branches{/branch}","tags_url":"https://api.github.com/repos/hyangtack/armeria/tags","blobs_url":"https://api.github.com/repos/hyangtack/armeria/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hyangtack/armeria/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hyangtack/armeria/git/refs{/sha}","trees_url":"https://api.github.com/repos/hyangtack/armeria/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hyangtack/armeria/statuses/{sha}","languages_url":"https://api.github.com/repos/hyangtack/armeria/languages","stargazers_url":"https://api.github.com/repos/hyangtack/armeria/stargazers","contributors_url":"https://api.github.com/repos/hyangtack/armeria/contributors","subscribers_url":"https://api.github.com/repos/hyangtack/armeria/subscribers","subscription_url":"https://api.github.com/repos/hyangtack/armeria/subscription","commits_url":"https://api.github.com/repos/hyangtack/armeria/commits{/sha}","git_commits_url":"https://api.github.com/repos/hyangtack/armeria/git/commits{/sha}","comments_url":"https://api.github.com/repos/hyangtack/armeria/comments{/number}","issue_comment_url":"https://api.github.com/repos/hyangtack/armeria/issues/comments{/number}","contents_url":"https://api.github.com/repos/hyangtack/armeria/contents/{+path}","compare_url":"https://api.github.com/repos/hyangtack/armeria/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hyangtack/armeria/merges","archive_url":"https://api.github.com/repos/hyangtack/armeria/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hyangtack/armeria/downloads","issues_url":"https://api.github.com/repos/hyangtack/armeria/issues{/number}","pulls_url":"https://api.github.com/repos/hyangtack/armeria/pulls{/number}","milestones_url":"https://api.github.com/repos/hyangtack/armeria/milestones{/number}","notifications_url":"https://api.github.com/repos/hyangtack/armeria/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hyangtack/armeria/labels{/name}","releases_url":"https://api.github.com/repos/hyangtack/armeria/releases{/id}","deployments_url":"https://api.github.com/repos/hyangtack/armeria/deployments","created_at":"2015-12-22T12:16:46Z","updated_at":"2016-02-18T10:05:21Z","pushed_at":"2018-04-23T09:09:11Z","git_url":"git://github.com/hyangtack/armeria.git","ssh_url":"git@github.com:hyangtack/armeria.git","clone_url":"https://github.com/hyangtack/armeria.git","svn_url":"https://github.com/hyangtack/armeria","homepage":"http://line.github.io/armeria/","size":28561,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"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":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"line:master","ref":"master","sha":"dd910822d278cbddb41367850b2a94a344566afd","user":{"login":"line","id":13128444,"avatar_url":"https://avatars2.githubusercontent.com/u/13128444?v=4","gravatar_id":"","url":"https://api.github.com/users/line","html_url":"https://github.com/line","followers_url":"https://api.github.com/users/line/followers","following_url":"https://api.github.com/users/line/following{/other_user}","gists_url":"https://api.github.com/users/line/gists{/gist_id}","starred_url":"https://api.github.com/users/line/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/line/subscriptions","organizations_url":"https://api.github.com/users/line/orgs","repos_url":"https://api.github.com/users/line/repos","events_url":"https://api.github.com/users/line/events{/privacy}","received_events_url":"https://api.github.com/users/line/received_events","type":"Organization","site_admin":false},"repo":{"id":46251204,"name":"armeria","full_name":"line/armeria","owner":{"login":"line","id":13128444,"avatar_url":"https://avatars2.githubusercontent.com/u/13128444?v=4","gravatar_id":"","url":"https://api.github.com/users/line","html_url":"https://github.com/line","followers_url":"https://api.github.com/users/line/followers","following_url":"https://api.github.com/users/line/following{/other_user}","gists_url":"https://api.github.com/users/line/gists{/gist_id}","starred_url":"https://api.github.com/users/line/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/line/subscriptions","organizations_url":"https://api.github.com/users/line/orgs","repos_url":"https://api.github.com/users/line/repos","events_url":"https://api.github.com/users/line/events{/privacy}","received_events_url":"https://api.github.com/users/line/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/line/armeria","description":"Asynchronous RPC/REST library built on top of Java 8, Netty, HTTP/2, Thrift and gRPC","fork":false,"url":"https://api.github.com/repos/line/armeria","forks_url":"https://api.github.com/repos/line/armeria/forks","keys_url":"https://api.github.com/repos/line/armeria/keys{/key_id}","collaborators_url":"https://api.github.com/repos/line/armeria/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/line/armeria/teams","hooks_url":"https://api.github.com/repos/line/armeria/hooks","issue_events_url":"https://api.github.com/repos/line/armeria/issues/events{/number}","events_url":"https://api.github.com/repos/line/armeria/events","assignees_url":"https://api.github.com/repos/line/armeria/assignees{/user}","branches_url":"https://api.github.com/repos/line/armeria/branches{/branch}","tags_url":"https://api.github.com/repos/line/armeria/tags","blobs_url":"https://api.github.com/repos/line/armeria/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/line/armeria/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/line/armeria/git/refs{/sha}","trees_url":"https://api.github.com/repos/line/armeria/git/trees{/sha}","statuses_url":"https://api.github.com/repos/line/armeria/statuses/{sha}","languages_url":"https://api.github.com/repos/line/armeria/languages","stargazers_url":"https://api.github.com/repos/line/armeria/stargazers","contributors_url":"https://api.github.com/repos/line/armeria/contributors","subscribers_url":"https://api.github.com/repos/line/armeria/subscribers","subscription_url":"https://api.github.com/repos/line/armeria/subscription","commits_url":"https://api.github.com/repos/line/armeria/commits{/sha}","git_commits_url":"https://api.github.com/repos/line/armeria/git/commits{/sha}","comments_url":"https://api.github.com/repos/line/armeria/comments{/number}","issue_comment_url":"https://api.github.com/repos/line/armeria/issues/comments{/number}","contents_url":"https://api.github.com/repos/line/armeria/contents/{+path}","compare_url":"https://api.github.com/repos/line/armeria/compare/{base}...{head}","merges_url":"https://api.github.com/repos/line/armeria/merges","archive_url":"https://api.github.com/repos/line/armeria/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/line/armeria/downloads","issues_url":"https://api.github.com/repos/line/armeria/issues{/number}","pulls_url":"https://api.github.com/repos/line/armeria/pulls{/number}","milestones_url":"https://api.github.com/repos/line/armeria/milestones{/number}","notifications_url":"https://api.github.com/repos/line/armeria/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/line/armeria/labels{/name}","releases_url":"https://api.github.com/repos/line/armeria/releases{/id}","deployments_url":"https://api.github.com/repos/line/armeria/deployments","created_at":"2015-11-16T04:04:01Z","updated_at":"2018-04-23T07:16:35Z","pushed_at":"2018-04-23T09:31:35Z","git_url":"git://github.com/line/armeria.git","ssh_url":"git@github.com:line/armeria.git","clone_url":"https://github.com/line/armeria.git","svn_url":"https://github.com/line/armeria","homepage":"https://line.github.io/armeria/","size":31207,"stargazers_count":1204,"watchers_count":1204,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":278,"mirror_url":null,"archived":false,"open_issues_count":115,"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":278,"open_issues":115,"watchers":1204,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/line/armeria/pulls/1147"},"html":{"href":"https://github.com/line/armeria/pull/1147"},"issue":{"href":"https://api.github.com/repos/line/armeria/issues/1147"},"comments":{"href":"https://api.github.com/repos/line/armeria/issues/1147/comments"},"review_comments":{"href":"https://api.github.com/repos/line/armeria/pulls/1147/comments"},"review_comment":{"href":"https://api.github.com/repos/line/armeria/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/line/armeria/pulls/1147/commits"},"statuses":{"href":"https://api.github.com/repos/line/armeria/statuses/5dabc89b6249ba5ed721d9bae3301db1b8997ed8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"hyangtack"}}