{"action":"opened","number":125,"pull_request":{"url":"https://api.github.com/repos/apotonick/roar/pulls/125","id":27241881,"html_url":"https://github.com/apotonick/roar/pull/125","diff_url":"https://github.com/apotonick/roar/pull/125.diff","patch_url":"https://github.com/apotonick/roar/pull/125.patch","issue_url":"https://api.github.com/repos/apotonick/roar/issues/125","number":125,"state":"open","locked":false,"title":"JSONAPI Decorator collection serialization","user":{"login":"pd","id":510,"avatar_url":"https://avatars.githubusercontent.com/u/510?v=3","gravatar_id":"","url":"https://api.github.com/users/pd","html_url":"https://github.com/pd","followers_url":"https://api.github.com/users/pd/followers","following_url":"https://api.github.com/users/pd/following{/other_user}","gists_url":"https://api.github.com/users/pd/gists{/gist_id}","starred_url":"https://api.github.com/users/pd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pd/subscriptions","organizations_url":"https://api.github.com/users/pd/orgs","repos_url":"https://api.github.com/users/pd/repos","events_url":"https://api.github.com/users/pd/events{/privacy}","received_events_url":"https://api.github.com/users/pd/received_events","type":"User","site_admin":false},"body":"When using the Decorator-style, JSONAPI representations for collections are returning an array of individually serialized resources. I've made a small change in json_api_test to enable a test that I think was meant to cover this behavior. A more minimal example of the issue:\r\n\r\n~~~ruby\r\nWidget = Struct.new(:id)\r\n\r\nclass WidgetDecorator < Roar::Decorator\r\n  include Roar::JSON::JSONAPI\r\n  type :widgets\r\n  property :id\r\nend\r\n\r\nwidgets = [Widget.new(1), Widget.new(2)]\r\nWidgetDecorator.for_collection.prepare(widgets).to_hash\r\n# => [{\"widgets\"=>{\"id\"=>1}}, {\"widgets\"=>{\"id\"=>2}}]\r\n~~~\r\n\r\nI haven't had a chance to dig into the implementation yet, so the travis build should be failing on the 2 tests now enabled.","created_at":"2015-01-13T01:32:52Z","updated_at":"2015-01-13T01:32:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"77b529cc9f3dbe30f3321b9b63289f7cae8e543a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apotonick/roar/pulls/125/commits","review_comments_url":"https://api.github.com/repos/apotonick/roar/pulls/125/comments","review_comment_url":"https://api.github.com/repos/apotonick/roar/pulls/comments/{number}","comments_url":"https://api.github.com/repos/apotonick/roar/issues/125/comments","statuses_url":"https://api.github.com/repos/apotonick/roar/statuses/0b87979565d15460e385c63f696fb41d7c1c8568","head":{"label":"pd:jsonapi-collection-decorator","ref":"jsonapi-collection-decorator","sha":"0b87979565d15460e385c63f696fb41d7c1c8568","user":{"login":"pd","id":510,"avatar_url":"https://avatars.githubusercontent.com/u/510?v=3","gravatar_id":"","url":"https://api.github.com/users/pd","html_url":"https://github.com/pd","followers_url":"https://api.github.com/users/pd/followers","following_url":"https://api.github.com/users/pd/following{/other_user}","gists_url":"https://api.github.com/users/pd/gists{/gist_id}","starred_url":"https://api.github.com/users/pd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pd/subscriptions","organizations_url":"https://api.github.com/users/pd/orgs","repos_url":"https://api.github.com/users/pd/repos","events_url":"https://api.github.com/users/pd/events{/privacy}","received_events_url":"https://api.github.com/users/pd/received_events","type":"User","site_admin":false},"repo":{"id":29165524,"name":"roar","full_name":"pd/roar","owner":{"login":"pd","id":510,"avatar_url":"https://avatars.githubusercontent.com/u/510?v=3","gravatar_id":"","url":"https://api.github.com/users/pd","html_url":"https://github.com/pd","followers_url":"https://api.github.com/users/pd/followers","following_url":"https://api.github.com/users/pd/following{/other_user}","gists_url":"https://api.github.com/users/pd/gists{/gist_id}","starred_url":"https://api.github.com/users/pd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pd/subscriptions","organizations_url":"https://api.github.com/users/pd/orgs","repos_url":"https://api.github.com/users/pd/repos","events_url":"https://api.github.com/users/pd/events{/privacy}","received_events_url":"https://api.github.com/users/pd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pd/roar","description":"Parse and render REST API documents using representers.","fork":true,"url":"https://api.github.com/repos/pd/roar","forks_url":"https://api.github.com/repos/pd/roar/forks","keys_url":"https://api.github.com/repos/pd/roar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pd/roar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pd/roar/teams","hooks_url":"https://api.github.com/repos/pd/roar/hooks","issue_events_url":"https://api.github.com/repos/pd/roar/issues/events{/number}","events_url":"https://api.github.com/repos/pd/roar/events","assignees_url":"https://api.github.com/repos/pd/roar/assignees{/user}","branches_url":"https://api.github.com/repos/pd/roar/branches{/branch}","tags_url":"https://api.github.com/repos/pd/roar/tags","blobs_url":"https://api.github.com/repos/pd/roar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pd/roar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pd/roar/git/refs{/sha}","trees_url":"https://api.github.com/repos/pd/roar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pd/roar/statuses/{sha}","languages_url":"https://api.github.com/repos/pd/roar/languages","stargazers_url":"https://api.github.com/repos/pd/roar/stargazers","contributors_url":"https://api.github.com/repos/pd/roar/contributors","subscribers_url":"https://api.github.com/repos/pd/roar/subscribers","subscription_url":"https://api.github.com/repos/pd/roar/subscription","commits_url":"https://api.github.com/repos/pd/roar/commits{/sha}","git_commits_url":"https://api.github.com/repos/pd/roar/git/commits{/sha}","comments_url":"https://api.github.com/repos/pd/roar/comments{/number}","issue_comment_url":"https://api.github.com/repos/pd/roar/issues/comments/{number}","contents_url":"https://api.github.com/repos/pd/roar/contents/{+path}","compare_url":"https://api.github.com/repos/pd/roar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pd/roar/merges","archive_url":"https://api.github.com/repos/pd/roar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pd/roar/downloads","issues_url":"https://api.github.com/repos/pd/roar/issues{/number}","pulls_url":"https://api.github.com/repos/pd/roar/pulls{/number}","milestones_url":"https://api.github.com/repos/pd/roar/milestones{/number}","notifications_url":"https://api.github.com/repos/pd/roar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pd/roar/labels{/name}","releases_url":"https://api.github.com/repos/pd/roar/releases{/id}","created_at":"2015-01-13T01:04:56Z","updated_at":"2015-01-13T01:04:57Z","pushed_at":"2015-01-13T01:20:45Z","git_url":"git://github.com/pd/roar.git","ssh_url":"git@github.com:pd/roar.git","clone_url":"https://github.com/pd/roar.git","svn_url":"https://github.com/pd/roar","homepage":"http://www.trailblazerb.org","size":1918,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"apotonick:master","ref":"master","sha":"854ac65c8e7b0a2ee6b552fbed93673be52bdfc6","user":{"login":"apotonick","id":10406,"avatar_url":"https://avatars.githubusercontent.com/u/10406?v=3","gravatar_id":"","url":"https://api.github.com/users/apotonick","html_url":"https://github.com/apotonick","followers_url":"https://api.github.com/users/apotonick/followers","following_url":"https://api.github.com/users/apotonick/following{/other_user}","gists_url":"https://api.github.com/users/apotonick/gists{/gist_id}","starred_url":"https://api.github.com/users/apotonick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apotonick/subscriptions","organizations_url":"https://api.github.com/users/apotonick/orgs","repos_url":"https://api.github.com/users/apotonick/repos","events_url":"https://api.github.com/users/apotonick/events{/privacy}","received_events_url":"https://api.github.com/users/apotonick/received_events","type":"User","site_admin":false},"repo":{"id":1212717,"name":"roar","full_name":"apotonick/roar","owner":{"login":"apotonick","id":10406,"avatar_url":"https://avatars.githubusercontent.com/u/10406?v=3","gravatar_id":"","url":"https://api.github.com/users/apotonick","html_url":"https://github.com/apotonick","followers_url":"https://api.github.com/users/apotonick/followers","following_url":"https://api.github.com/users/apotonick/following{/other_user}","gists_url":"https://api.github.com/users/apotonick/gists{/gist_id}","starred_url":"https://api.github.com/users/apotonick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apotonick/subscriptions","organizations_url":"https://api.github.com/users/apotonick/orgs","repos_url":"https://api.github.com/users/apotonick/repos","events_url":"https://api.github.com/users/apotonick/events{/privacy}","received_events_url":"https://api.github.com/users/apotonick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/apotonick/roar","description":"Parse and render REST API documents using representers.","fork":false,"url":"https://api.github.com/repos/apotonick/roar","forks_url":"https://api.github.com/repos/apotonick/roar/forks","keys_url":"https://api.github.com/repos/apotonick/roar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apotonick/roar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apotonick/roar/teams","hooks_url":"https://api.github.com/repos/apotonick/roar/hooks","issue_events_url":"https://api.github.com/repos/apotonick/roar/issues/events{/number}","events_url":"https://api.github.com/repos/apotonick/roar/events","assignees_url":"https://api.github.com/repos/apotonick/roar/assignees{/user}","branches_url":"https://api.github.com/repos/apotonick/roar/branches{/branch}","tags_url":"https://api.github.com/repos/apotonick/roar/tags","blobs_url":"https://api.github.com/repos/apotonick/roar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apotonick/roar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apotonick/roar/git/refs{/sha}","trees_url":"https://api.github.com/repos/apotonick/roar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apotonick/roar/statuses/{sha}","languages_url":"https://api.github.com/repos/apotonick/roar/languages","stargazers_url":"https://api.github.com/repos/apotonick/roar/stargazers","contributors_url":"https://api.github.com/repos/apotonick/roar/contributors","subscribers_url":"https://api.github.com/repos/apotonick/roar/subscribers","subscription_url":"https://api.github.com/repos/apotonick/roar/subscription","commits_url":"https://api.github.com/repos/apotonick/roar/commits{/sha}","git_commits_url":"https://api.github.com/repos/apotonick/roar/git/commits{/sha}","comments_url":"https://api.github.com/repos/apotonick/roar/comments{/number}","issue_comment_url":"https://api.github.com/repos/apotonick/roar/issues/comments/{number}","contents_url":"https://api.github.com/repos/apotonick/roar/contents/{+path}","compare_url":"https://api.github.com/repos/apotonick/roar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apotonick/roar/merges","archive_url":"https://api.github.com/repos/apotonick/roar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apotonick/roar/downloads","issues_url":"https://api.github.com/repos/apotonick/roar/issues{/number}","pulls_url":"https://api.github.com/repos/apotonick/roar/pulls{/number}","milestones_url":"https://api.github.com/repos/apotonick/roar/milestones{/number}","notifications_url":"https://api.github.com/repos/apotonick/roar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apotonick/roar/labels{/name}","releases_url":"https://api.github.com/repos/apotonick/roar/releases{/id}","created_at":"2011-01-01T18:22:16Z","updated_at":"2015-01-13T01:16:33Z","pushed_at":"2015-01-13T01:16:31Z","git_url":"git://github.com/apotonick/roar.git","ssh_url":"git@github.com:apotonick/roar.git","clone_url":"https://github.com/apotonick/roar.git","svn_url":"https://github.com/apotonick/roar","homepage":"http://www.trailblazerb.org","size":1918,"stargazers_count":1264,"watchers_count":1264,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":94,"mirror_url":null,"open_issues_count":23,"forks":94,"open_issues":23,"watchers":1264,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apotonick/roar/pulls/125"},"html":{"href":"https://github.com/apotonick/roar/pull/125"},"issue":{"href":"https://api.github.com/repos/apotonick/roar/issues/125"},"comments":{"href":"https://api.github.com/repos/apotonick/roar/issues/125/comments"},"review_comments":{"href":"https://api.github.com/repos/apotonick/roar/pulls/125/comments"},"review_comment":{"href":"https://api.github.com/repos/apotonick/roar/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/apotonick/roar/pulls/125/commits"},"statuses":{"href":"https://api.github.com/repos/apotonick/roar/statuses/0b87979565d15460e385c63f696fb41d7c1c8568"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":3,"deletions":3,"changed_files":1}}