{"action":"closed","number":105,"pull_request":{"url":"https://api.github.com/repos/scrogson/oauth2/pulls/105","id":164232093,"html_url":"https://github.com/scrogson/oauth2/pull/105","diff_url":"https://github.com/scrogson/oauth2/pull/105.diff","patch_url":"https://github.com/scrogson/oauth2/pull/105.patch","issue_url":"https://api.github.com/repos/scrogson/oauth2/issues/105","number":105,"state":"closed","locked":false,"title":"Changes `%{}` into correct map type specifications","user":{"login":"ymtszw","id":4507126,"avatar_url":"https://avatars3.githubusercontent.com/u/4507126?v=4","gravatar_id":"","url":"https://api.github.com/users/ymtszw","html_url":"https://github.com/ymtszw","followers_url":"https://api.github.com/users/ymtszw/followers","following_url":"https://api.github.com/users/ymtszw/following{/other_user}","gists_url":"https://api.github.com/users/ymtszw/gists{/gist_id}","starred_url":"https://api.github.com/users/ymtszw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ymtszw/subscriptions","organizations_url":"https://api.github.com/users/ymtszw/orgs","repos_url":"https://api.github.com/users/ymtszw/repos","events_url":"https://api.github.com/users/ymtszw/events{/privacy}","received_events_url":"https://api.github.com/users/ymtszw/received_events","type":"User","site_admin":false},"body":"It looks like [`%{}` stands for only \"empty\" maps in typespecs](https://hexdocs.pm/elixir/typespecs.html#literals) (whereas it can match for \"any\" maps on pattern matches).\r\n\r\nSo, currently codes like below are warned by dialyzer:\r\n\r\n```ex\r\n  defp ensure_admin_domain(%OAuth2.AccessToken{other_params: %{\"id_token\" => id_token}}) do\r\n    # Parse id_token of OpenID Connect, check authorizing user's domain\r\n    # ...\r\n  end\r\n  defp ensure_admin_domain(otherwise) do\r\n    {:error, :id_token_not_found}\r\n  end\r\n```\r\n\r\n```\r\n$ mix dialyze # Using https://github.com/fishcakez/dialyze\r\nFinding applications for analysis\r\nFinding suitable PLTs\r\nLooking up modules in dialyze_erlang-20.0_elixir-1.5.3_deps-dev.plt\r\nFinding applications for dialyze_erlang-20.0_elixir-1.5.3_deps-dev.plt\r\nFinding modules for dialyze_erlang-20.0_elixir-1.5.3_deps-dev.plt\r\nChecking 1725 modules in dialyze_erlang-20.0_elixir-1.5.3_deps-dev.plt\r\nFinding modules for analysis\r\nAnalysing 33 modules with dialyze_erlang-20.0_elixir-1.5.3_deps-dev.plt\r\nweb/repo/admin_token.ex:50: The pattern #{'other_params':=#{#{#<105>(8, 1, 'integer', ['unsigned', 'big']), #<100>(8, 1, 'integer', ['unsigned', 'big']), #<95>(8, 1, 'integer', ['unsigned', 'big']), #<116>(8, 1, 'integer', ['unsigned', 'big']), #<111>(8, 1, 'integer', ['unsigned', 'big']), #<107>(8, 1, 'integer', ['unsigned', 'big']), #<101>(8, 1, 'integer', ['unsigned', 'big']), #<110>(8, 1, 'integer', ['unsigned', 'big'])}#:=_id_token@1}, '__struct__':='Elixir.OAuth2.AccessToken'} can never match the type #{'__struct__':='Elixir.OAuth2.AccessToken', 'access_token':=binary(), 'expires_at':=integer(), 'other_params':=#{}, 'refresh_token':='nil' | binary(), 'token_type':=binary()}\r\n\r\n** (Mix) Dialyzer reported 1 warnings\r\n```\r\n\r\nThis PR fixes `other_params`'s typespec so that related codes will be correctly success-typed.\r\n\r\nAlso fixing `body` type as well, though it looks like `body` type is currently unused so it may well be removed. I can do that in this branch too, if requested.\r\n\r\nAnd thanks for developing/maintaining this library! Looking for your reviews ❤️ ","created_at":"2018-01-22T06:31:44Z","updated_at":"2018-02-05T17:42:08Z","closed_at":"2018-02-05T17:42:08Z","merged_at":"2018-02-05T17:42:08Z","merge_commit_sha":"4a1b2441700f34a54bb4446a36415b71217086d5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/scrogson/oauth2/pulls/105/commits","review_comments_url":"https://api.github.com/repos/scrogson/oauth2/pulls/105/comments","review_comment_url":"https://api.github.com/repos/scrogson/oauth2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scrogson/oauth2/issues/105/comments","statuses_url":"https://api.github.com/repos/scrogson/oauth2/statuses/ee93b95568cbcf1434cb3c71fdaeb0db95721ecc","head":{"label":"ymtszw:fix_incorrect_type","ref":"fix_incorrect_type","sha":"ee93b95568cbcf1434cb3c71fdaeb0db95721ecc","user":{"login":"ymtszw","id":4507126,"avatar_url":"https://avatars3.githubusercontent.com/u/4507126?v=4","gravatar_id":"","url":"https://api.github.com/users/ymtszw","html_url":"https://github.com/ymtszw","followers_url":"https://api.github.com/users/ymtszw/followers","following_url":"https://api.github.com/users/ymtszw/following{/other_user}","gists_url":"https://api.github.com/users/ymtszw/gists{/gist_id}","starred_url":"https://api.github.com/users/ymtszw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ymtszw/subscriptions","organizations_url":"https://api.github.com/users/ymtszw/orgs","repos_url":"https://api.github.com/users/ymtszw/repos","events_url":"https://api.github.com/users/ymtszw/events{/privacy}","received_events_url":"https://api.github.com/users/ymtszw/received_events","type":"User","site_admin":false},"repo":{"id":118414404,"name":"oauth2","full_name":"ymtszw/oauth2","owner":{"login":"ymtszw","id":4507126,"avatar_url":"https://avatars3.githubusercontent.com/u/4507126?v=4","gravatar_id":"","url":"https://api.github.com/users/ymtszw","html_url":"https://github.com/ymtszw","followers_url":"https://api.github.com/users/ymtszw/followers","following_url":"https://api.github.com/users/ymtszw/following{/other_user}","gists_url":"https://api.github.com/users/ymtszw/gists{/gist_id}","starred_url":"https://api.github.com/users/ymtszw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ymtszw/subscriptions","organizations_url":"https://api.github.com/users/ymtszw/orgs","repos_url":"https://api.github.com/users/ymtszw/repos","events_url":"https://api.github.com/users/ymtszw/events{/privacy}","received_events_url":"https://api.github.com/users/ymtszw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ymtszw/oauth2","description":"An Elixir OAuth 2.0 Client Library","fork":true,"url":"https://api.github.com/repos/ymtszw/oauth2","forks_url":"https://api.github.com/repos/ymtszw/oauth2/forks","keys_url":"https://api.github.com/repos/ymtszw/oauth2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ymtszw/oauth2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ymtszw/oauth2/teams","hooks_url":"https://api.github.com/repos/ymtszw/oauth2/hooks","issue_events_url":"https://api.github.com/repos/ymtszw/oauth2/issues/events{/number}","events_url":"https://api.github.com/repos/ymtszw/oauth2/events","assignees_url":"https://api.github.com/repos/ymtszw/oauth2/assignees{/user}","branches_url":"https://api.github.com/repos/ymtszw/oauth2/branches{/branch}","tags_url":"https://api.github.com/repos/ymtszw/oauth2/tags","blobs_url":"https://api.github.com/repos/ymtszw/oauth2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ymtszw/oauth2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ymtszw/oauth2/git/refs{/sha}","trees_url":"https://api.github.com/repos/ymtszw/oauth2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ymtszw/oauth2/statuses/{sha}","languages_url":"https://api.github.com/repos/ymtszw/oauth2/languages","stargazers_url":"https://api.github.com/repos/ymtszw/oauth2/stargazers","contributors_url":"https://api.github.com/repos/ymtszw/oauth2/contributors","subscribers_url":"https://api.github.com/repos/ymtszw/oauth2/subscribers","subscription_url":"https://api.github.com/repos/ymtszw/oauth2/subscription","commits_url":"https://api.github.com/repos/ymtszw/oauth2/commits{/sha}","git_commits_url":"https://api.github.com/repos/ymtszw/oauth2/git/commits{/sha}","comments_url":"https://api.github.com/repos/ymtszw/oauth2/comments{/number}","issue_comment_url":"https://api.github.com/repos/ymtszw/oauth2/issues/comments{/number}","contents_url":"https://api.github.com/repos/ymtszw/oauth2/contents/{+path}","compare_url":"https://api.github.com/repos/ymtszw/oauth2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ymtszw/oauth2/merges","archive_url":"https://api.github.com/repos/ymtszw/oauth2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ymtszw/oauth2/downloads","issues_url":"https://api.github.com/repos/ymtszw/oauth2/issues{/number}","pulls_url":"https://api.github.com/repos/ymtszw/oauth2/pulls{/number}","milestones_url":"https://api.github.com/repos/ymtszw/oauth2/milestones{/number}","notifications_url":"https://api.github.com/repos/ymtszw/oauth2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ymtszw/oauth2/labels{/name}","releases_url":"https://api.github.com/repos/ymtszw/oauth2/releases{/id}","deployments_url":"https://api.github.com/repos/ymtszw/oauth2/deployments","created_at":"2018-01-22T06:11:49Z","updated_at":"2018-01-22T06:11:51Z","pushed_at":"2018-01-22T06:18:13Z","git_url":"git://github.com/ymtszw/oauth2.git","ssh_url":"git@github.com:ymtszw/oauth2.git","clone_url":"https://github.com/ymtszw/oauth2.git","svn_url":"https://github.com/ymtszw/oauth2","homepage":"","size":224,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scrogson:master","ref":"master","sha":"f2362eda07920e0fb03b0b136d974ce0f6712b19","user":{"login":"scrogson","id":53274,"avatar_url":"https://avatars3.githubusercontent.com/u/53274?v=4","gravatar_id":"","url":"https://api.github.com/users/scrogson","html_url":"https://github.com/scrogson","followers_url":"https://api.github.com/users/scrogson/followers","following_url":"https://api.github.com/users/scrogson/following{/other_user}","gists_url":"https://api.github.com/users/scrogson/gists{/gist_id}","starred_url":"https://api.github.com/users/scrogson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrogson/subscriptions","organizations_url":"https://api.github.com/users/scrogson/orgs","repos_url":"https://api.github.com/users/scrogson/repos","events_url":"https://api.github.com/users/scrogson/events{/privacy}","received_events_url":"https://api.github.com/users/scrogson/received_events","type":"User","site_admin":false},"repo":{"id":20585853,"name":"oauth2","full_name":"scrogson/oauth2","owner":{"login":"scrogson","id":53274,"avatar_url":"https://avatars3.githubusercontent.com/u/53274?v=4","gravatar_id":"","url":"https://api.github.com/users/scrogson","html_url":"https://github.com/scrogson","followers_url":"https://api.github.com/users/scrogson/followers","following_url":"https://api.github.com/users/scrogson/following{/other_user}","gists_url":"https://api.github.com/users/scrogson/gists{/gist_id}","starred_url":"https://api.github.com/users/scrogson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrogson/subscriptions","organizations_url":"https://api.github.com/users/scrogson/orgs","repos_url":"https://api.github.com/users/scrogson/repos","events_url":"https://api.github.com/users/scrogson/events{/privacy}","received_events_url":"https://api.github.com/users/scrogson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/scrogson/oauth2","description":"An Elixir OAuth 2.0 Client Library","fork":false,"url":"https://api.github.com/repos/scrogson/oauth2","forks_url":"https://api.github.com/repos/scrogson/oauth2/forks","keys_url":"https://api.github.com/repos/scrogson/oauth2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scrogson/oauth2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scrogson/oauth2/teams","hooks_url":"https://api.github.com/repos/scrogson/oauth2/hooks","issue_events_url":"https://api.github.com/repos/scrogson/oauth2/issues/events{/number}","events_url":"https://api.github.com/repos/scrogson/oauth2/events","assignees_url":"https://api.github.com/repos/scrogson/oauth2/assignees{/user}","branches_url":"https://api.github.com/repos/scrogson/oauth2/branches{/branch}","tags_url":"https://api.github.com/repos/scrogson/oauth2/tags","blobs_url":"https://api.github.com/repos/scrogson/oauth2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scrogson/oauth2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scrogson/oauth2/git/refs{/sha}","trees_url":"https://api.github.com/repos/scrogson/oauth2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scrogson/oauth2/statuses/{sha}","languages_url":"https://api.github.com/repos/scrogson/oauth2/languages","stargazers_url":"https://api.github.com/repos/scrogson/oauth2/stargazers","contributors_url":"https://api.github.com/repos/scrogson/oauth2/contributors","subscribers_url":"https://api.github.com/repos/scrogson/oauth2/subscribers","subscription_url":"https://api.github.com/repos/scrogson/oauth2/subscription","commits_url":"https://api.github.com/repos/scrogson/oauth2/commits{/sha}","git_commits_url":"https://api.github.com/repos/scrogson/oauth2/git/commits{/sha}","comments_url":"https://api.github.com/repos/scrogson/oauth2/comments{/number}","issue_comment_url":"https://api.github.com/repos/scrogson/oauth2/issues/comments{/number}","contents_url":"https://api.github.com/repos/scrogson/oauth2/contents/{+path}","compare_url":"https://api.github.com/repos/scrogson/oauth2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scrogson/oauth2/merges","archive_url":"https://api.github.com/repos/scrogson/oauth2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scrogson/oauth2/downloads","issues_url":"https://api.github.com/repos/scrogson/oauth2/issues{/number}","pulls_url":"https://api.github.com/repos/scrogson/oauth2/pulls{/number}","milestones_url":"https://api.github.com/repos/scrogson/oauth2/milestones{/number}","notifications_url":"https://api.github.com/repos/scrogson/oauth2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scrogson/oauth2/labels{/name}","releases_url":"https://api.github.com/repos/scrogson/oauth2/releases{/id}","deployments_url":"https://api.github.com/repos/scrogson/oauth2/deployments","created_at":"2014-06-07T04:55:22Z","updated_at":"2018-01-30T08:49:54Z","pushed_at":"2018-02-05T17:42:08Z","git_url":"git://github.com/scrogson/oauth2.git","ssh_url":"git@github.com:scrogson/oauth2.git","clone_url":"https://github.com/scrogson/oauth2.git","svn_url":"https://github.com/scrogson/oauth2","homepage":"","size":225,"stargazers_count":406,"watchers_count":406,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":81,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":81,"open_issues":3,"watchers":406,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scrogson/oauth2/pulls/105"},"html":{"href":"https://github.com/scrogson/oauth2/pull/105"},"issue":{"href":"https://api.github.com/repos/scrogson/oauth2/issues/105"},"comments":{"href":"https://api.github.com/repos/scrogson/oauth2/issues/105/comments"},"review_comments":{"href":"https://api.github.com/repos/scrogson/oauth2/pulls/105/comments"},"review_comment":{"href":"https://api.github.com/repos/scrogson/oauth2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scrogson/oauth2/pulls/105/commits"},"statuses":{"href":"https://api.github.com/repos/scrogson/oauth2/statuses/ee93b95568cbcf1434cb3c71fdaeb0db95721ecc"}},"author_association":"NONE","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"scrogson","id":53274,"avatar_url":"https://avatars3.githubusercontent.com/u/53274?v=4","gravatar_id":"","url":"https://api.github.com/users/scrogson","html_url":"https://github.com/scrogson","followers_url":"https://api.github.com/users/scrogson/followers","following_url":"https://api.github.com/users/scrogson/following{/other_user}","gists_url":"https://api.github.com/users/scrogson/gists{/gist_id}","starred_url":"https://api.github.com/users/scrogson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrogson/subscriptions","organizations_url":"https://api.github.com/users/scrogson/orgs","repos_url":"https://api.github.com/users/scrogson/repos","events_url":"https://api.github.com/users/scrogson/events{/privacy}","received_events_url":"https://api.github.com/users/scrogson/received_events","type":"User","site_admin":false},"comments":3,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":2,"deletions":2,"changed_files":1}}
{"actor":{"display_login":"scrogson"}}