{"action":"closed","number":287,"pull_request":{"url":"https://api.github.com/repos/Netflix/feign/pulls/287","id":49052169,"html_url":"https://github.com/Netflix/feign/pull/287","diff_url":"https://github.com/Netflix/feign/pull/287.diff","patch_url":"https://github.com/Netflix/feign/pull/287.patch","issue_url":"https://api.github.com/repos/Netflix/feign/issues/287","number":287,"state":"closed","locked":false,"title":"Proof of concept for Visitor-pattern-based handling of Responses","user":{"login":"uschi2000","id":6528449,"avatar_url":"https://avatars.githubusercontent.com/u/6528449?v=3","gravatar_id":"","url":"https://api.github.com/users/uschi2000","html_url":"https://github.com/uschi2000","followers_url":"https://api.github.com/users/uschi2000/followers","following_url":"https://api.github.com/users/uschi2000/following{/other_user}","gists_url":"https://api.github.com/users/uschi2000/gists{/gist_id}","starred_url":"https://api.github.com/users/uschi2000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uschi2000/subscriptions","organizations_url":"https://api.github.com/users/uschi2000/orgs","repos_url":"https://api.github.com/users/uschi2000/repos","events_url":"https://api.github.com/users/uschi2000/events{/privacy}","received_events_url":"https://api.github.com/users/uschi2000/received_events","type":"User","site_admin":false},"body":"Hi @adriancole ,\r\n\r\nThis pull-request is a proof-of-concept for making response handling more flexible. (Note that I haven't fixed up the tests, so it doesn't compile.) The motivation is as follows: Our servers often return 404s for non-existing resources and we'd like to surface those as Optional#absent (Guava or Java8) in clients, rather than as exceptions. Given the current architecture of response handling in SynchronousResponseHandler this is not possible since the configured Decoder is only invoked for [200, 300) error codes. This PR shows how to use a Visitor pattern to make response handling more flexible and configurable.\r\n\r\nI'd like to know if you'd in principle be happy to consider this or a similar approach, or if you are opposed based on some fundamental consideration. In the former case, I'm happy to get APIs and tests in good shape according to your suggestions. Back-compat of the Feign.Builder class will be an issue.\r\n\r\nCheers!\r\n  Robert","created_at":"2015-10-28T19:04:47Z","updated_at":"2015-10-28T22:25:03Z","closed_at":"2015-10-28T22:25:03Z","merged_at":null,"merge_commit_sha":"8dbf50a9735c0221b934ba510bf0ed4262c6d712","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Netflix/feign/pulls/287/commits","review_comments_url":"https://api.github.com/repos/Netflix/feign/pulls/287/comments","review_comment_url":"https://api.github.com/repos/Netflix/feign/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Netflix/feign/issues/287/comments","statuses_url":"https://api.github.com/repos/Netflix/feign/statuses/c3679c954b359d7b454bd6f2c20d2ca70a6fa27b","head":{"label":"uschi2000:feature/visitor","ref":"feature/visitor","sha":"c3679c954b359d7b454bd6f2c20d2ca70a6fa27b","user":{"login":"uschi2000","id":6528449,"avatar_url":"https://avatars.githubusercontent.com/u/6528449?v=3","gravatar_id":"","url":"https://api.github.com/users/uschi2000","html_url":"https://github.com/uschi2000","followers_url":"https://api.github.com/users/uschi2000/followers","following_url":"https://api.github.com/users/uschi2000/following{/other_user}","gists_url":"https://api.github.com/users/uschi2000/gists{/gist_id}","starred_url":"https://api.github.com/users/uschi2000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uschi2000/subscriptions","organizations_url":"https://api.github.com/users/uschi2000/orgs","repos_url":"https://api.github.com/users/uschi2000/repos","events_url":"https://api.github.com/users/uschi2000/events{/privacy}","received_events_url":"https://api.github.com/users/uschi2000/received_events","type":"User","site_admin":false},"repo":{"id":45135209,"name":"feign","full_name":"uschi2000/feign","owner":{"login":"uschi2000","id":6528449,"avatar_url":"https://avatars.githubusercontent.com/u/6528449?v=3","gravatar_id":"","url":"https://api.github.com/users/uschi2000","html_url":"https://github.com/uschi2000","followers_url":"https://api.github.com/users/uschi2000/followers","following_url":"https://api.github.com/users/uschi2000/following{/other_user}","gists_url":"https://api.github.com/users/uschi2000/gists{/gist_id}","starred_url":"https://api.github.com/users/uschi2000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uschi2000/subscriptions","organizations_url":"https://api.github.com/users/uschi2000/orgs","repos_url":"https://api.github.com/users/uschi2000/repos","events_url":"https://api.github.com/users/uschi2000/events{/privacy}","received_events_url":"https://api.github.com/users/uschi2000/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/uschi2000/feign","description":"Feign makes writing java http clients easier","fork":true,"url":"https://api.github.com/repos/uschi2000/feign","forks_url":"https://api.github.com/repos/uschi2000/feign/forks","keys_url":"https://api.github.com/repos/uschi2000/feign/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uschi2000/feign/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uschi2000/feign/teams","hooks_url":"https://api.github.com/repos/uschi2000/feign/hooks","issue_events_url":"https://api.github.com/repos/uschi2000/feign/issues/events{/number}","events_url":"https://api.github.com/repos/uschi2000/feign/events","assignees_url":"https://api.github.com/repos/uschi2000/feign/assignees{/user}","branches_url":"https://api.github.com/repos/uschi2000/feign/branches{/branch}","tags_url":"https://api.github.com/repos/uschi2000/feign/tags","blobs_url":"https://api.github.com/repos/uschi2000/feign/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uschi2000/feign/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uschi2000/feign/git/refs{/sha}","trees_url":"https://api.github.com/repos/uschi2000/feign/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uschi2000/feign/statuses/{sha}","languages_url":"https://api.github.com/repos/uschi2000/feign/languages","stargazers_url":"https://api.github.com/repos/uschi2000/feign/stargazers","contributors_url":"https://api.github.com/repos/uschi2000/feign/contributors","subscribers_url":"https://api.github.com/repos/uschi2000/feign/subscribers","subscription_url":"https://api.github.com/repos/uschi2000/feign/subscription","commits_url":"https://api.github.com/repos/uschi2000/feign/commits{/sha}","git_commits_url":"https://api.github.com/repos/uschi2000/feign/git/commits{/sha}","comments_url":"https://api.github.com/repos/uschi2000/feign/comments{/number}","issue_comment_url":"https://api.github.com/repos/uschi2000/feign/issues/comments{/number}","contents_url":"https://api.github.com/repos/uschi2000/feign/contents/{+path}","compare_url":"https://api.github.com/repos/uschi2000/feign/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uschi2000/feign/merges","archive_url":"https://api.github.com/repos/uschi2000/feign/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uschi2000/feign/downloads","issues_url":"https://api.github.com/repos/uschi2000/feign/issues{/number}","pulls_url":"https://api.github.com/repos/uschi2000/feign/pulls{/number}","milestones_url":"https://api.github.com/repos/uschi2000/feign/milestones{/number}","notifications_url":"https://api.github.com/repos/uschi2000/feign/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uschi2000/feign/labels{/name}","releases_url":"https://api.github.com/repos/uschi2000/feign/releases{/id}","created_at":"2015-10-28T18:58:19Z","updated_at":"2015-10-28T18:58:20Z","pushed_at":"2015-10-28T18:58:45Z","git_url":"git://github.com/uschi2000/feign.git","ssh_url":"git@github.com:uschi2000/feign.git","clone_url":"https://github.com/uschi2000/feign.git","svn_url":"https://github.com/uschi2000/feign","homepage":"","size":8446,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Netflix:master","ref":"master","sha":"c9c5e31c7fc422f595a45ad37303ab52ad091386","user":{"login":"Netflix","id":913567,"avatar_url":"https://avatars.githubusercontent.com/u/913567?v=3","gravatar_id":"","url":"https://api.github.com/users/Netflix","html_url":"https://github.com/Netflix","followers_url":"https://api.github.com/users/Netflix/followers","following_url":"https://api.github.com/users/Netflix/following{/other_user}","gists_url":"https://api.github.com/users/Netflix/gists{/gist_id}","starred_url":"https://api.github.com/users/Netflix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Netflix/subscriptions","organizations_url":"https://api.github.com/users/Netflix/orgs","repos_url":"https://api.github.com/users/Netflix/repos","events_url":"https://api.github.com/users/Netflix/events{/privacy}","received_events_url":"https://api.github.com/users/Netflix/received_events","type":"Organization","site_admin":false},"repo":{"id":10981994,"name":"feign","full_name":"Netflix/feign","owner":{"login":"Netflix","id":913567,"avatar_url":"https://avatars.githubusercontent.com/u/913567?v=3","gravatar_id":"","url":"https://api.github.com/users/Netflix","html_url":"https://github.com/Netflix","followers_url":"https://api.github.com/users/Netflix/followers","following_url":"https://api.github.com/users/Netflix/following{/other_user}","gists_url":"https://api.github.com/users/Netflix/gists{/gist_id}","starred_url":"https://api.github.com/users/Netflix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Netflix/subscriptions","organizations_url":"https://api.github.com/users/Netflix/orgs","repos_url":"https://api.github.com/users/Netflix/repos","events_url":"https://api.github.com/users/Netflix/events{/privacy}","received_events_url":"https://api.github.com/users/Netflix/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Netflix/feign","description":"Feign makes writing java http clients easier","fork":false,"url":"https://api.github.com/repos/Netflix/feign","forks_url":"https://api.github.com/repos/Netflix/feign/forks","keys_url":"https://api.github.com/repos/Netflix/feign/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Netflix/feign/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Netflix/feign/teams","hooks_url":"https://api.github.com/repos/Netflix/feign/hooks","issue_events_url":"https://api.github.com/repos/Netflix/feign/issues/events{/number}","events_url":"https://api.github.com/repos/Netflix/feign/events","assignees_url":"https://api.github.com/repos/Netflix/feign/assignees{/user}","branches_url":"https://api.github.com/repos/Netflix/feign/branches{/branch}","tags_url":"https://api.github.com/repos/Netflix/feign/tags","blobs_url":"https://api.github.com/repos/Netflix/feign/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Netflix/feign/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Netflix/feign/git/refs{/sha}","trees_url":"https://api.github.com/repos/Netflix/feign/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Netflix/feign/statuses/{sha}","languages_url":"https://api.github.com/repos/Netflix/feign/languages","stargazers_url":"https://api.github.com/repos/Netflix/feign/stargazers","contributors_url":"https://api.github.com/repos/Netflix/feign/contributors","subscribers_url":"https://api.github.com/repos/Netflix/feign/subscribers","subscription_url":"https://api.github.com/repos/Netflix/feign/subscription","commits_url":"https://api.github.com/repos/Netflix/feign/commits{/sha}","git_commits_url":"https://api.github.com/repos/Netflix/feign/git/commits{/sha}","comments_url":"https://api.github.com/repos/Netflix/feign/comments{/number}","issue_comment_url":"https://api.github.com/repos/Netflix/feign/issues/comments{/number}","contents_url":"https://api.github.com/repos/Netflix/feign/contents/{+path}","compare_url":"https://api.github.com/repos/Netflix/feign/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Netflix/feign/merges","archive_url":"https://api.github.com/repos/Netflix/feign/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Netflix/feign/downloads","issues_url":"https://api.github.com/repos/Netflix/feign/issues{/number}","pulls_url":"https://api.github.com/repos/Netflix/feign/pulls{/number}","milestones_url":"https://api.github.com/repos/Netflix/feign/milestones{/number}","notifications_url":"https://api.github.com/repos/Netflix/feign/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Netflix/feign/labels{/name}","releases_url":"https://api.github.com/repos/Netflix/feign/releases{/id}","created_at":"2013-06-26T23:28:16Z","updated_at":"2015-10-28T22:21:57Z","pushed_at":"2015-10-28T19:04:47Z","git_url":"git://github.com/Netflix/feign.git","ssh_url":"git@github.com:Netflix/feign.git","clone_url":"https://github.com/Netflix/feign.git","svn_url":"https://github.com/Netflix/feign","homepage":"","size":8446,"stargazers_count":597,"watchers_count":597,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":118,"mirror_url":null,"open_issues_count":17,"forks":118,"open_issues":17,"watchers":597,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Netflix/feign/pulls/287"},"html":{"href":"https://github.com/Netflix/feign/pull/287"},"issue":{"href":"https://api.github.com/repos/Netflix/feign/issues/287"},"comments":{"href":"https://api.github.com/repos/Netflix/feign/issues/287/comments"},"review_comments":{"href":"https://api.github.com/repos/Netflix/feign/pulls/287/comments"},"review_comment":{"href":"https://api.github.com/repos/Netflix/feign/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Netflix/feign/pulls/287/commits"},"statuses":{"href":"https://api.github.com/repos/Netflix/feign/statuses/c3679c954b359d7b454bd6f2c20d2ca70a6fa27b"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":3,"review_comments":2,"commits":1,"additions":137,"deletions":55,"changed_files":5}}