{"action":"created","comment":{"url":"https://api.github.com/repos/manyminds/api2go/pulls/comments/46760042","id":46760042,"diff_hunk":"@@ -16,229 +15,234 @@ import (\n var _ = Describe(\"Unmarshal\", func() {\n \tContext(\"When unmarshaling simple objects\", func() {\n \t\tt, _ := time.Parse(time.RFC3339, \"2014-11-10T16:30:48.823Z\")\n-\t\tsingleJSON := []byte(`{\"data\":{\"id\": \"1\", \"type\": \"simplePosts\", \"attributes\": {\"title\":\"First Post\",\"text\":\"Lipsum\", \"Created\": \"2014-11-10T16:30:48.823Z\"}}}`)\n+\t\t/*","path":"jsonapi/unmarshal_test.go","position":13,"original_position":13,"commit_id":"2dac7e3f59c01495881db129593f30dd2c423bba","original_commit_id":"2dac7e3f59c01495881db129593f30dd2c423bba","user":{"login":"sharpner","id":574362,"avatar_url":"https://avatars.githubusercontent.com/u/574362?v=3","gravatar_id":"","url":"https://api.github.com/users/sharpner","html_url":"https://github.com/sharpner","followers_url":"https://api.github.com/users/sharpner/followers","following_url":"https://api.github.com/users/sharpner/following{/other_user}","gists_url":"https://api.github.com/users/sharpner/gists{/gist_id}","starred_url":"https://api.github.com/users/sharpner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharpner/subscriptions","organizations_url":"https://api.github.com/users/sharpner/orgs","repos_url":"https://api.github.com/users/sharpner/repos","events_url":"https://api.github.com/users/sharpner/events{/privacy}","received_events_url":"https://api.github.com/users/sharpner/received_events","type":"User","site_admin":false},"body":"what's with the commented code?","created_at":"2015-12-05T16:27:10Z","updated_at":"2015-12-05T16:27:10Z","html_url":"https://github.com/manyminds/api2go/pull/202#discussion_r46760042","pull_request_url":"https://api.github.com/repos/manyminds/api2go/pulls/202","_links":{"self":{"href":"https://api.github.com/repos/manyminds/api2go/pulls/comments/46760042"},"html":{"href":"https://github.com/manyminds/api2go/pull/202#discussion_r46760042"},"pull_request":{"href":"https://api.github.com/repos/manyminds/api2go/pulls/202"}}},"pull_request":{"url":"https://api.github.com/repos/manyminds/api2go/pulls/202","id":47504914,"html_url":"https://github.com/manyminds/api2go/pull/202","diff_url":"https://github.com/manyminds/api2go/pull/202.diff","patch_url":"https://github.com/manyminds/api2go/pull/202.patch","issue_url":"https://api.github.com/repos/manyminds/api2go/issues/202","number":202,"state":"open","locked":false,"title":"Major Refactoring: Fully typed structs that represent a jsonapi document","user":{"login":"wwwdata","id":818880,"avatar_url":"https://avatars.githubusercontent.com/u/818880?v=3","gravatar_id":"","url":"https://api.github.com/users/wwwdata","html_url":"https://github.com/wwwdata","followers_url":"https://api.github.com/users/wwwdata/followers","following_url":"https://api.github.com/users/wwwdata/following{/other_user}","gists_url":"https://api.github.com/users/wwwdata/gists{/gist_id}","starred_url":"https://api.github.com/users/wwwdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wwwdata/subscriptions","organizations_url":"https://api.github.com/users/wwwdata/orgs","repos_url":"https://api.github.com/users/wwwdata/repos","events_url":"https://api.github.com/users/wwwdata/events{/privacy}","received_events_url":"https://api.github.com/users/wwwdata/received_events","type":"User","site_admin":false},"body":"### Background\r\nIt would be nice to finally get rid/ridder of the large untyped `map[string]interface{}` for our internal marshal/unmarshal methods. Especially regarding the #111 refactor unmarshaling task, a more statically typed internal data handling would be beneficial.\r\n\r\nNow that all the payload is inside an attributes object in the json, this totally makes sense. When you look back how jsonapi started, this completely untyped approach seemed necessary, but now with the final specs, there is a better way!\r\n\r\n### This PR will change a lot for api2go:\r\n- We will be completely standard compatible. That means that we just use a normal `json.Marshal` and `json.Unmarshal` from the standard `encoding/json` package of go.\r\n- Everything else is already inside interface methods and will be collected by executing these implemented methods.\r\n- The main payload of a struct is just it's marshalled representation inside the `attributes` object in the jsonapi json. \r\n\r\n### Goals\r\n- Finally get rid of bugs with specific special types\r\n- Let the user marshal anything, because he can now just simply implement his own `Marshaler` and `Unmarshaler` interfaces and it will always work!\r\n\r\n### Stuff that will break:\r\n- Automatic renaming of fields (but maybe we can support that). It is advised to now use the `json:\"yourName\"` tag annotations\r\n- Custom Content Marshalers that want to export anything else than JSON.. The new implementation is completely based upon the JSON interfaces from go.\r\n\r\n### TODO\r\n- [x] Jsonapi Package Marshal/Unmarshal\r\n- [x] Api Package\r\n- [x] Test package\r\n- [x] Increase Test Coverage!\r\n- [x] Documentation\r\n- [x] Remove stuff from helpers.go \r\n- [x] Squash/Rebase to polish comits to be ready for review","created_at":"2015-10-13T08:39:33Z","updated_at":"2015-12-05T16:27:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5c282560efa3215d82a5c11e16b759b9861144bd","assignee":null,"milestone":{"url":"https://api.github.com/repos/manyminds/api2go/milestones/2","html_url":"https://github.com/manyminds/api2go/milestones/Release%201.0","labels_url":"https://api.github.com/repos/manyminds/api2go/milestones/2/labels","id":1150629,"number":2,"title":"Release 1.0","description":null,"creator":{"login":"sharpner","id":574362,"avatar_url":"https://avatars.githubusercontent.com/u/574362?v=3","gravatar_id":"","url":"https://api.github.com/users/sharpner","html_url":"https://github.com/sharpner","followers_url":"https://api.github.com/users/sharpner/followers","following_url":"https://api.github.com/users/sharpner/following{/other_user}","gists_url":"https://api.github.com/users/sharpner/gists{/gist_id}","starred_url":"https://api.github.com/users/sharpner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharpner/subscriptions","organizations_url":"https://api.github.com/users/sharpner/orgs","repos_url":"https://api.github.com/users/sharpner/repos","events_url":"https://api.github.com/users/sharpner/events{/privacy}","received_events_url":"https://api.github.com/users/sharpner/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":8,"state":"open","created_at":"2015-06-05T06:18:27Z","updated_at":"2015-11-02T09:51:08Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/manyminds/api2go/pulls/202/commits","review_comments_url":"https://api.github.com/repos/manyminds/api2go/pulls/202/comments","review_comment_url":"https://api.github.com/repos/manyminds/api2go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/manyminds/api2go/issues/202/comments","statuses_url":"https://api.github.com/repos/manyminds/api2go/statuses/2dac7e3f59c01495881db129593f30dd2c423bba","head":{"label":"manyminds:internal-data-structs","ref":"internal-data-structs","sha":"2dac7e3f59c01495881db129593f30dd2c423bba","user":{"login":"manyminds","id":11178018,"avatar_url":"https://avatars.githubusercontent.com/u/11178018?v=3","gravatar_id":"","url":"https://api.github.com/users/manyminds","html_url":"https://github.com/manyminds","followers_url":"https://api.github.com/users/manyminds/followers","following_url":"https://api.github.com/users/manyminds/following{/other_user}","gists_url":"https://api.github.com/users/manyminds/gists{/gist_id}","starred_url":"https://api.github.com/users/manyminds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manyminds/subscriptions","organizations_url":"https://api.github.com/users/manyminds/orgs","repos_url":"https://api.github.com/users/manyminds/repos","events_url":"https://api.github.com/users/manyminds/events{/privacy}","received_events_url":"https://api.github.com/users/manyminds/received_events","type":"Organization","site_admin":false},"repo":{"id":23196256,"name":"api2go","full_name":"manyminds/api2go","owner":{"login":"manyminds","id":11178018,"avatar_url":"https://avatars.githubusercontent.com/u/11178018?v=3","gravatar_id":"","url":"https://api.github.com/users/manyminds","html_url":"https://github.com/manyminds","followers_url":"https://api.github.com/users/manyminds/followers","following_url":"https://api.github.com/users/manyminds/following{/other_user}","gists_url":"https://api.github.com/users/manyminds/gists{/gist_id}","starred_url":"https://api.github.com/users/manyminds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manyminds/subscriptions","organizations_url":"https://api.github.com/users/manyminds/orgs","repos_url":"https://api.github.com/users/manyminds/repos","events_url":"https://api.github.com/users/manyminds/events{/privacy}","received_events_url":"https://api.github.com/users/manyminds/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/manyminds/api2go","description":"JSONAPI.org Implementation for Go","fork":false,"url":"https://api.github.com/repos/manyminds/api2go","forks_url":"https://api.github.com/repos/manyminds/api2go/forks","keys_url":"https://api.github.com/repos/manyminds/api2go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/manyminds/api2go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/manyminds/api2go/teams","hooks_url":"https://api.github.com/repos/manyminds/api2go/hooks","issue_events_url":"https://api.github.com/repos/manyminds/api2go/issues/events{/number}","events_url":"https://api.github.com/repos/manyminds/api2go/events","assignees_url":"https://api.github.com/repos/manyminds/api2go/assignees{/user}","branches_url":"https://api.github.com/repos/manyminds/api2go/branches{/branch}","tags_url":"https://api.github.com/repos/manyminds/api2go/tags","blobs_url":"https://api.github.com/repos/manyminds/api2go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/manyminds/api2go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/manyminds/api2go/git/refs{/sha}","trees_url":"https://api.github.com/repos/manyminds/api2go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/manyminds/api2go/statuses/{sha}","languages_url":"https://api.github.com/repos/manyminds/api2go/languages","stargazers_url":"https://api.github.com/repos/manyminds/api2go/stargazers","contributors_url":"https://api.github.com/repos/manyminds/api2go/contributors","subscribers_url":"https://api.github.com/repos/manyminds/api2go/subscribers","subscription_url":"https://api.github.com/repos/manyminds/api2go/subscription","commits_url":"https://api.github.com/repos/manyminds/api2go/commits{/sha}","git_commits_url":"https://api.github.com/repos/manyminds/api2go/git/commits{/sha}","comments_url":"https://api.github.com/repos/manyminds/api2go/comments{/number}","issue_comment_url":"https://api.github.com/repos/manyminds/api2go/issues/comments{/number}","contents_url":"https://api.github.com/repos/manyminds/api2go/contents/{+path}","compare_url":"https://api.github.com/repos/manyminds/api2go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/manyminds/api2go/merges","archive_url":"https://api.github.com/repos/manyminds/api2go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/manyminds/api2go/downloads","issues_url":"https://api.github.com/repos/manyminds/api2go/issues{/number}","pulls_url":"https://api.github.com/repos/manyminds/api2go/pulls{/number}","milestones_url":"https://api.github.com/repos/manyminds/api2go/milestones{/number}","notifications_url":"https://api.github.com/repos/manyminds/api2go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/manyminds/api2go/labels{/name}","releases_url":"https://api.github.com/repos/manyminds/api2go/releases{/id}","created_at":"2014-08-21T17:23:27Z","updated_at":"2015-12-04T07:05:16Z","pushed_at":"2015-12-05T11:10:10Z","git_url":"git://github.com/manyminds/api2go.git","ssh_url":"git@github.com:manyminds/api2go.git","clone_url":"https://github.com/manyminds/api2go.git","svn_url":"https://github.com/manyminds/api2go","homepage":"","size":554,"stargazers_count":226,"watchers_count":226,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":12,"forks":25,"open_issues":12,"watchers":226,"default_branch":"master"}},"base":{"label":"manyminds:master","ref":"master","sha":"6049e4bf26ae32ab2d52cd906203107e7e3e9c4b","user":{"login":"manyminds","id":11178018,"avatar_url":"https://avatars.githubusercontent.com/u/11178018?v=3","gravatar_id":"","url":"https://api.github.com/users/manyminds","html_url":"https://github.com/manyminds","followers_url":"https://api.github.com/users/manyminds/followers","following_url":"https://api.github.com/users/manyminds/following{/other_user}","gists_url":"https://api.github.com/users/manyminds/gists{/gist_id}","starred_url":"https://api.github.com/users/manyminds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manyminds/subscriptions","organizations_url":"https://api.github.com/users/manyminds/orgs","repos_url":"https://api.github.com/users/manyminds/repos","events_url":"https://api.github.com/users/manyminds/events{/privacy}","received_events_url":"https://api.github.com/users/manyminds/received_events","type":"Organization","site_admin":false},"repo":{"id":23196256,"name":"api2go","full_name":"manyminds/api2go","owner":{"login":"manyminds","id":11178018,"avatar_url":"https://avatars.githubusercontent.com/u/11178018?v=3","gravatar_id":"","url":"https://api.github.com/users/manyminds","html_url":"https://github.com/manyminds","followers_url":"https://api.github.com/users/manyminds/followers","following_url":"https://api.github.com/users/manyminds/following{/other_user}","gists_url":"https://api.github.com/users/manyminds/gists{/gist_id}","starred_url":"https://api.github.com/users/manyminds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manyminds/subscriptions","organizations_url":"https://api.github.com/users/manyminds/orgs","repos_url":"https://api.github.com/users/manyminds/repos","events_url":"https://api.github.com/users/manyminds/events{/privacy}","received_events_url":"https://api.github.com/users/manyminds/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/manyminds/api2go","description":"JSONAPI.org Implementation for Go","fork":false,"url":"https://api.github.com/repos/manyminds/api2go","forks_url":"https://api.github.com/repos/manyminds/api2go/forks","keys_url":"https://api.github.com/repos/manyminds/api2go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/manyminds/api2go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/manyminds/api2go/teams","hooks_url":"https://api.github.com/repos/manyminds/api2go/hooks","issue_events_url":"https://api.github.com/repos/manyminds/api2go/issues/events{/number}","events_url":"https://api.github.com/repos/manyminds/api2go/events","assignees_url":"https://api.github.com/repos/manyminds/api2go/assignees{/user}","branches_url":"https://api.github.com/repos/manyminds/api2go/branches{/branch}","tags_url":"https://api.github.com/repos/manyminds/api2go/tags","blobs_url":"https://api.github.com/repos/manyminds/api2go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/manyminds/api2go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/manyminds/api2go/git/refs{/sha}","trees_url":"https://api.github.com/repos/manyminds/api2go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/manyminds/api2go/statuses/{sha}","languages_url":"https://api.github.com/repos/manyminds/api2go/languages","stargazers_url":"https://api.github.com/repos/manyminds/api2go/stargazers","contributors_url":"https://api.github.com/repos/manyminds/api2go/contributors","subscribers_url":"https://api.github.com/repos/manyminds/api2go/subscribers","subscription_url":"https://api.github.com/repos/manyminds/api2go/subscription","commits_url":"https://api.github.com/repos/manyminds/api2go/commits{/sha}","git_commits_url":"https://api.github.com/repos/manyminds/api2go/git/commits{/sha}","comments_url":"https://api.github.com/repos/manyminds/api2go/comments{/number}","issue_comment_url":"https://api.github.com/repos/manyminds/api2go/issues/comments{/number}","contents_url":"https://api.github.com/repos/manyminds/api2go/contents/{+path}","compare_url":"https://api.github.com/repos/manyminds/api2go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/manyminds/api2go/merges","archive_url":"https://api.github.com/repos/manyminds/api2go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/manyminds/api2go/downloads","issues_url":"https://api.github.com/repos/manyminds/api2go/issues{/number}","pulls_url":"https://api.github.com/repos/manyminds/api2go/pulls{/number}","milestones_url":"https://api.github.com/repos/manyminds/api2go/milestones{/number}","notifications_url":"https://api.github.com/repos/manyminds/api2go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/manyminds/api2go/labels{/name}","releases_url":"https://api.github.com/repos/manyminds/api2go/releases{/id}","created_at":"2014-08-21T17:23:27Z","updated_at":"2015-12-04T07:05:16Z","pushed_at":"2015-12-05T11:10:10Z","git_url":"git://github.com/manyminds/api2go.git","ssh_url":"git@github.com:manyminds/api2go.git","clone_url":"https://github.com/manyminds/api2go.git","svn_url":"https://github.com/manyminds/api2go","homepage":"","size":554,"stargazers_count":226,"watchers_count":226,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":12,"forks":25,"open_issues":12,"watchers":226,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/manyminds/api2go/pulls/202"},"html":{"href":"https://github.com/manyminds/api2go/pull/202"},"issue":{"href":"https://api.github.com/repos/manyminds/api2go/issues/202"},"comments":{"href":"https://api.github.com/repos/manyminds/api2go/issues/202/comments"},"review_comments":{"href":"https://api.github.com/repos/manyminds/api2go/pulls/202/comments"},"review_comment":{"href":"https://api.github.com/repos/manyminds/api2go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/manyminds/api2go/pulls/202/commits"},"statuses":{"href":"https://api.github.com/repos/manyminds/api2go/statuses/2dac7e3f59c01495881db129593f30dd2c423bba"}}}}