{"action":"opened","number":60,"pull_request":{"url":"https://api.github.com/repos/gaearon/normalizr/pulls/60","id":57787854,"html_url":"https://github.com/gaearon/normalizr/pull/60","diff_url":"https://github.com/gaearon/normalizr/pull/60.diff","patch_url":"https://github.com/gaearon/normalizr/pull/60.patch","issue_url":"https://api.github.com/repos/gaearon/normalizr/issues/60","number":60,"state":"open","locked":false,"title":"Edit Usage and normalize() examples to explain second parameter better","user":{"login":"fredrikolovsson","id":12738484,"avatar_url":"https://avatars.githubusercontent.com/u/12738484?v=3","gravatar_id":"","url":"https://api.github.com/users/fredrikolovsson","html_url":"https://github.com/fredrikolovsson","followers_url":"https://api.github.com/users/fredrikolovsson/followers","following_url":"https://api.github.com/users/fredrikolovsson/following{/other_user}","gists_url":"https://api.github.com/users/fredrikolovsson/gists{/gist_id}","starred_url":"https://api.github.com/users/fredrikolovsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredrikolovsson/subscriptions","organizations_url":"https://api.github.com/users/fredrikolovsson/orgs","repos_url":"https://api.github.com/users/fredrikolovsson/repos","events_url":"https://api.github.com/users/fredrikolovsson/events{/privacy}","received_events_url":"https://api.github.com/users/fredrikolovsson/received_events","type":"User","site_admin":false},"body":"This concerns improving the Usage example to better show how the second parameter for normalize() is used. \r\n\r\nCurrently, the example in the Usage section has these two normalize calls, which handle responses with similar structure:\r\n```\r\nresponse = normalize(response, {\r\n  articles: arrayOf(article)\r\n});\r\n\r\nresponse = normalize(response, {\r\n  users: arrayOf(user)\r\n});\r\n```\r\nThe example could be more informative, if it showed how to normalize two different response object structures, like this:\r\n```\r\n// response is just one article object\r\nresponse = normalize(response, article);\r\n\r\n// response is an object with a reference to an array of article objects\r\nresponse = normalize(response, {\r\n  articles: arrayOf(article)\r\n});\r\n```\r\nIn addition to revising the Usage example, I suggest adding these examples to the normalize() specification.\r\n\r\nIt took me a while to figure out why my normalized data did not look as expected, and while I am new to the field, maybe someone else could also be saved some time by this, without making the README significantly longer.\r\n\r\nThanks for your great work and please let me know if there is something I should fix to make this a proper improvement.","created_at":"2016-02-01T01:22:50Z","updated_at":"2016-02-01T01:22:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"19f44e7fa42e5a8f2b945549fc532e871769645a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gaearon/normalizr/pulls/60/commits","review_comments_url":"https://api.github.com/repos/gaearon/normalizr/pulls/60/comments","review_comment_url":"https://api.github.com/repos/gaearon/normalizr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gaearon/normalizr/issues/60/comments","statuses_url":"https://api.github.com/repos/gaearon/normalizr/statuses/1a48a1f5ed06f4a1e7a9ce0afcba573cf4a09ff1","head":{"label":"fredrikolovsson:master","ref":"master","sha":"1a48a1f5ed06f4a1e7a9ce0afcba573cf4a09ff1","user":{"login":"fredrikolovsson","id":12738484,"avatar_url":"https://avatars.githubusercontent.com/u/12738484?v=3","gravatar_id":"","url":"https://api.github.com/users/fredrikolovsson","html_url":"https://github.com/fredrikolovsson","followers_url":"https://api.github.com/users/fredrikolovsson/followers","following_url":"https://api.github.com/users/fredrikolovsson/following{/other_user}","gists_url":"https://api.github.com/users/fredrikolovsson/gists{/gist_id}","starred_url":"https://api.github.com/users/fredrikolovsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredrikolovsson/subscriptions","organizations_url":"https://api.github.com/users/fredrikolovsson/orgs","repos_url":"https://api.github.com/users/fredrikolovsson/repos","events_url":"https://api.github.com/users/fredrikolovsson/events{/privacy}","received_events_url":"https://api.github.com/users/fredrikolovsson/received_events","type":"User","site_admin":false},"repo":{"id":50798930,"name":"normalizr","full_name":"fredrikolovsson/normalizr","owner":{"login":"fredrikolovsson","id":12738484,"avatar_url":"https://avatars.githubusercontent.com/u/12738484?v=3","gravatar_id":"","url":"https://api.github.com/users/fredrikolovsson","html_url":"https://github.com/fredrikolovsson","followers_url":"https://api.github.com/users/fredrikolovsson/followers","following_url":"https://api.github.com/users/fredrikolovsson/following{/other_user}","gists_url":"https://api.github.com/users/fredrikolovsson/gists{/gist_id}","starred_url":"https://api.github.com/users/fredrikolovsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredrikolovsson/subscriptions","organizations_url":"https://api.github.com/users/fredrikolovsson/orgs","repos_url":"https://api.github.com/users/fredrikolovsson/repos","events_url":"https://api.github.com/users/fredrikolovsson/events{/privacy}","received_events_url":"https://api.github.com/users/fredrikolovsson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fredrikolovsson/normalizr","description":"Normalizes nested JSON according to a schema","fork":true,"url":"https://api.github.com/repos/fredrikolovsson/normalizr","forks_url":"https://api.github.com/repos/fredrikolovsson/normalizr/forks","keys_url":"https://api.github.com/repos/fredrikolovsson/normalizr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fredrikolovsson/normalizr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fredrikolovsson/normalizr/teams","hooks_url":"https://api.github.com/repos/fredrikolovsson/normalizr/hooks","issue_events_url":"https://api.github.com/repos/fredrikolovsson/normalizr/issues/events{/number}","events_url":"https://api.github.com/repos/fredrikolovsson/normalizr/events","assignees_url":"https://api.github.com/repos/fredrikolovsson/normalizr/assignees{/user}","branches_url":"https://api.github.com/repos/fredrikolovsson/normalizr/branches{/branch}","tags_url":"https://api.github.com/repos/fredrikolovsson/normalizr/tags","blobs_url":"https://api.github.com/repos/fredrikolovsson/normalizr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fredrikolovsson/normalizr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fredrikolovsson/normalizr/git/refs{/sha}","trees_url":"https://api.github.com/repos/fredrikolovsson/normalizr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fredrikolovsson/normalizr/statuses/{sha}","languages_url":"https://api.github.com/repos/fredrikolovsson/normalizr/languages","stargazers_url":"https://api.github.com/repos/fredrikolovsson/normalizr/stargazers","contributors_url":"https://api.github.com/repos/fredrikolovsson/normalizr/contributors","subscribers_url":"https://api.github.com/repos/fredrikolovsson/normalizr/subscribers","subscription_url":"https://api.github.com/repos/fredrikolovsson/normalizr/subscription","commits_url":"https://api.github.com/repos/fredrikolovsson/normalizr/commits{/sha}","git_commits_url":"https://api.github.com/repos/fredrikolovsson/normalizr/git/commits{/sha}","comments_url":"https://api.github.com/repos/fredrikolovsson/normalizr/comments{/number}","issue_comment_url":"https://api.github.com/repos/fredrikolovsson/normalizr/issues/comments{/number}","contents_url":"https://api.github.com/repos/fredrikolovsson/normalizr/contents/{+path}","compare_url":"https://api.github.com/repos/fredrikolovsson/normalizr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fredrikolovsson/normalizr/merges","archive_url":"https://api.github.com/repos/fredrikolovsson/normalizr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fredrikolovsson/normalizr/downloads","issues_url":"https://api.github.com/repos/fredrikolovsson/normalizr/issues{/number}","pulls_url":"https://api.github.com/repos/fredrikolovsson/normalizr/pulls{/number}","milestones_url":"https://api.github.com/repos/fredrikolovsson/normalizr/milestones{/number}","notifications_url":"https://api.github.com/repos/fredrikolovsson/normalizr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fredrikolovsson/normalizr/labels{/name}","releases_url":"https://api.github.com/repos/fredrikolovsson/normalizr/releases{/id}","deployments_url":"https://api.github.com/repos/fredrikolovsson/normalizr/deployments","created_at":"2016-01-31T22:29:23Z","updated_at":"2016-01-31T22:29:24Z","pushed_at":"2016-02-01T00:46:36Z","git_url":"git://github.com/fredrikolovsson/normalizr.git","ssh_url":"git@github.com:fredrikolovsson/normalizr.git","clone_url":"https://github.com/fredrikolovsson/normalizr.git","svn_url":"https://github.com/fredrikolovsson/normalizr","homepage":"","size":67,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"gaearon:master","ref":"master","sha":"d3457983661351a96ef222e95c2845b65e12ee0b","user":{"login":"gaearon","id":810438,"avatar_url":"https://avatars.githubusercontent.com/u/810438?v=3","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"repo":{"id":23141830,"name":"normalizr","full_name":"gaearon/normalizr","owner":{"login":"gaearon","id":810438,"avatar_url":"https://avatars.githubusercontent.com/u/810438?v=3","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gaearon/normalizr","description":"Normalizes nested JSON according to a schema","fork":false,"url":"https://api.github.com/repos/gaearon/normalizr","forks_url":"https://api.github.com/repos/gaearon/normalizr/forks","keys_url":"https://api.github.com/repos/gaearon/normalizr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gaearon/normalizr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gaearon/normalizr/teams","hooks_url":"https://api.github.com/repos/gaearon/normalizr/hooks","issue_events_url":"https://api.github.com/repos/gaearon/normalizr/issues/events{/number}","events_url":"https://api.github.com/repos/gaearon/normalizr/events","assignees_url":"https://api.github.com/repos/gaearon/normalizr/assignees{/user}","branches_url":"https://api.github.com/repos/gaearon/normalizr/branches{/branch}","tags_url":"https://api.github.com/repos/gaearon/normalizr/tags","blobs_url":"https://api.github.com/repos/gaearon/normalizr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gaearon/normalizr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gaearon/normalizr/git/refs{/sha}","trees_url":"https://api.github.com/repos/gaearon/normalizr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gaearon/normalizr/statuses/{sha}","languages_url":"https://api.github.com/repos/gaearon/normalizr/languages","stargazers_url":"https://api.github.com/repos/gaearon/normalizr/stargazers","contributors_url":"https://api.github.com/repos/gaearon/normalizr/contributors","subscribers_url":"https://api.github.com/repos/gaearon/normalizr/subscribers","subscription_url":"https://api.github.com/repos/gaearon/normalizr/subscription","commits_url":"https://api.github.com/repos/gaearon/normalizr/commits{/sha}","git_commits_url":"https://api.github.com/repos/gaearon/normalizr/git/commits{/sha}","comments_url":"https://api.github.com/repos/gaearon/normalizr/comments{/number}","issue_comment_url":"https://api.github.com/repos/gaearon/normalizr/issues/comments{/number}","contents_url":"https://api.github.com/repos/gaearon/normalizr/contents/{+path}","compare_url":"https://api.github.com/repos/gaearon/normalizr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gaearon/normalizr/merges","archive_url":"https://api.github.com/repos/gaearon/normalizr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gaearon/normalizr/downloads","issues_url":"https://api.github.com/repos/gaearon/normalizr/issues{/number}","pulls_url":"https://api.github.com/repos/gaearon/normalizr/pulls{/number}","milestones_url":"https://api.github.com/repos/gaearon/normalizr/milestones{/number}","notifications_url":"https://api.github.com/repos/gaearon/normalizr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gaearon/normalizr/labels{/name}","releases_url":"https://api.github.com/repos/gaearon/normalizr/releases{/id}","deployments_url":"https://api.github.com/repos/gaearon/normalizr/deployments","created_at":"2014-08-20T08:41:38Z","updated_at":"2016-02-01T01:17:42Z","pushed_at":"2016-02-01T01:22:50Z","git_url":"git://github.com/gaearon/normalizr.git","ssh_url":"git@github.com:gaearon/normalizr.git","clone_url":"https://github.com/gaearon/normalizr.git","svn_url":"https://github.com/gaearon/normalizr","homepage":"","size":76,"stargazers_count":2112,"watchers_count":2112,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":54,"mirror_url":null,"open_issues_count":7,"forks":54,"open_issues":7,"watchers":2112,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gaearon/normalizr/pulls/60"},"html":{"href":"https://github.com/gaearon/normalizr/pull/60"},"issue":{"href":"https://api.github.com/repos/gaearon/normalizr/issues/60"},"comments":{"href":"https://api.github.com/repos/gaearon/normalizr/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/gaearon/normalizr/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/gaearon/normalizr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gaearon/normalizr/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/gaearon/normalizr/statuses/1a48a1f5ed06f4a1e7a9ce0afcba573cf4a09ff1"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":4,"additions":81,"deletions":60,"changed_files":1}}