{"action":"opened","number":260,"pull_request":{"url":"https://api.github.com/repos/trentm/node-bunyan/pulls/260","id":36704004,"html_url":"https://github.com/trentm/node-bunyan/pull/260","diff_url":"https://github.com/trentm/node-bunyan/pull/260.diff","patch_url":"https://github.com/trentm/node-bunyan/pull/260.patch","issue_url":"https://api.github.com/repos/trentm/node-bunyan/issues/260","number":260,"state":"open","locked":false,"title":"Combine parent child serializer.","user":{"login":"chyipin","id":11436549,"avatar_url":"https://avatars.githubusercontent.com/u/11436549?v=3","gravatar_id":"","url":"https://api.github.com/users/chyipin","html_url":"https://github.com/chyipin","followers_url":"https://api.github.com/users/chyipin/followers","following_url":"https://api.github.com/users/chyipin/following{/other_user}","gists_url":"https://api.github.com/users/chyipin/gists{/gist_id}","starred_url":"https://api.github.com/users/chyipin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chyipin/subscriptions","organizations_url":"https://api.github.com/users/chyipin/orgs","repos_url":"https://api.github.com/users/chyipin/repos","events_url":"https://api.github.com/users/chyipin/events{/privacy}","received_events_url":"https://api.github.com/users/chyipin/received_events","type":"User","site_admin":false},"body":"Extend child serializer to merge serialized data for parent serializer with same fields.\r\n\r\nCurrently, child serializer for specific fields will override the parent serializer.  This prevents custom serialization at parent level.\r\nParent:\r\n```\r\n        serializers: {\r\n            req: function (req) {\r\n              return {\r\n                username: req.user.username\r\n              };\r\n            }\r\n        }\r\n```\r\nChild:\r\n```\r\n        serializers: {\r\n            req: function (req) {\r\n              return {\r\n                // other fields: timers, stats, etc\r\n              };\r\n            }\r\n        }\r\n```\r\nPrimary use case is restify audit logger.  \r\nThe proposed changes applies the serializers from parent and child, and merge the serialized result preferring the data from the child if there are field collision (similar to a simple `_.merge).  If there happens to be a clash in field names, the fix would be to change the field name for the serializer in the parent.\r\n","created_at":"2015-06-02T08:17:49Z","updated_at":"2015-06-02T08:17:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/trentm/node-bunyan/pulls/260/commits","review_comments_url":"https://api.github.com/repos/trentm/node-bunyan/pulls/260/comments","review_comment_url":"https://api.github.com/repos/trentm/node-bunyan/pulls/comments{/number}","comments_url":"https://api.github.com/repos/trentm/node-bunyan/issues/260/comments","statuses_url":"https://api.github.com/repos/trentm/node-bunyan/statuses/7a922548a4247192d0154de05aae950e7061319e","head":{"label":"chyipin:master","ref":"master","sha":"7a922548a4247192d0154de05aae950e7061319e","user":{"login":"chyipin","id":11436549,"avatar_url":"https://avatars.githubusercontent.com/u/11436549?v=3","gravatar_id":"","url":"https://api.github.com/users/chyipin","html_url":"https://github.com/chyipin","followers_url":"https://api.github.com/users/chyipin/followers","following_url":"https://api.github.com/users/chyipin/following{/other_user}","gists_url":"https://api.github.com/users/chyipin/gists{/gist_id}","starred_url":"https://api.github.com/users/chyipin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chyipin/subscriptions","organizations_url":"https://api.github.com/users/chyipin/orgs","repos_url":"https://api.github.com/users/chyipin/repos","events_url":"https://api.github.com/users/chyipin/events{/privacy}","received_events_url":"https://api.github.com/users/chyipin/received_events","type":"User","site_admin":false},"repo":{"id":36717682,"name":"node-bunyan","full_name":"chyipin/node-bunyan","owner":{"login":"chyipin","id":11436549,"avatar_url":"https://avatars.githubusercontent.com/u/11436549?v=3","gravatar_id":"","url":"https://api.github.com/users/chyipin","html_url":"https://github.com/chyipin","followers_url":"https://api.github.com/users/chyipin/followers","following_url":"https://api.github.com/users/chyipin/following{/other_user}","gists_url":"https://api.github.com/users/chyipin/gists{/gist_id}","starred_url":"https://api.github.com/users/chyipin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chyipin/subscriptions","organizations_url":"https://api.github.com/users/chyipin/orgs","repos_url":"https://api.github.com/users/chyipin/repos","events_url":"https://api.github.com/users/chyipin/events{/privacy}","received_events_url":"https://api.github.com/users/chyipin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chyipin/node-bunyan","description":"a simple and fast JSON logging module for node.js services","fork":true,"url":"https://api.github.com/repos/chyipin/node-bunyan","forks_url":"https://api.github.com/repos/chyipin/node-bunyan/forks","keys_url":"https://api.github.com/repos/chyipin/node-bunyan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chyipin/node-bunyan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chyipin/node-bunyan/teams","hooks_url":"https://api.github.com/repos/chyipin/node-bunyan/hooks","issue_events_url":"https://api.github.com/repos/chyipin/node-bunyan/issues/events{/number}","events_url":"https://api.github.com/repos/chyipin/node-bunyan/events","assignees_url":"https://api.github.com/repos/chyipin/node-bunyan/assignees{/user}","branches_url":"https://api.github.com/repos/chyipin/node-bunyan/branches{/branch}","tags_url":"https://api.github.com/repos/chyipin/node-bunyan/tags","blobs_url":"https://api.github.com/repos/chyipin/node-bunyan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chyipin/node-bunyan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chyipin/node-bunyan/git/refs{/sha}","trees_url":"https://api.github.com/repos/chyipin/node-bunyan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chyipin/node-bunyan/statuses/{sha}","languages_url":"https://api.github.com/repos/chyipin/node-bunyan/languages","stargazers_url":"https://api.github.com/repos/chyipin/node-bunyan/stargazers","contributors_url":"https://api.github.com/repos/chyipin/node-bunyan/contributors","subscribers_url":"https://api.github.com/repos/chyipin/node-bunyan/subscribers","subscription_url":"https://api.github.com/repos/chyipin/node-bunyan/subscription","commits_url":"https://api.github.com/repos/chyipin/node-bunyan/commits{/sha}","git_commits_url":"https://api.github.com/repos/chyipin/node-bunyan/git/commits{/sha}","comments_url":"https://api.github.com/repos/chyipin/node-bunyan/comments{/number}","issue_comment_url":"https://api.github.com/repos/chyipin/node-bunyan/issues/comments{/number}","contents_url":"https://api.github.com/repos/chyipin/node-bunyan/contents/{+path}","compare_url":"https://api.github.com/repos/chyipin/node-bunyan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chyipin/node-bunyan/merges","archive_url":"https://api.github.com/repos/chyipin/node-bunyan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chyipin/node-bunyan/downloads","issues_url":"https://api.github.com/repos/chyipin/node-bunyan/issues{/number}","pulls_url":"https://api.github.com/repos/chyipin/node-bunyan/pulls{/number}","milestones_url":"https://api.github.com/repos/chyipin/node-bunyan/milestones{/number}","notifications_url":"https://api.github.com/repos/chyipin/node-bunyan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chyipin/node-bunyan/labels{/name}","releases_url":"https://api.github.com/repos/chyipin/node-bunyan/releases{/id}","created_at":"2015-06-02T08:01:20Z","updated_at":"2015-06-02T08:01:21Z","pushed_at":"2015-06-02T08:06:53Z","git_url":"git://github.com/chyipin/node-bunyan.git","ssh_url":"git@github.com:chyipin/node-bunyan.git","clone_url":"https://github.com/chyipin/node-bunyan.git","svn_url":"https://github.com/chyipin/node-bunyan","homepage":"","size":3186,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"trentm:master","ref":"master","sha":"15f2bb11336d9ff483eb74af161023a021e74344","user":{"login":"trentm","id":46866,"avatar_url":"https://avatars.githubusercontent.com/u/46866?v=3","gravatar_id":"","url":"https://api.github.com/users/trentm","html_url":"https://github.com/trentm","followers_url":"https://api.github.com/users/trentm/followers","following_url":"https://api.github.com/users/trentm/following{/other_user}","gists_url":"https://api.github.com/users/trentm/gists{/gist_id}","starred_url":"https://api.github.com/users/trentm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trentm/subscriptions","organizations_url":"https://api.github.com/users/trentm/orgs","repos_url":"https://api.github.com/users/trentm/repos","events_url":"https://api.github.com/users/trentm/events{/privacy}","received_events_url":"https://api.github.com/users/trentm/received_events","type":"User","site_admin":false},"repo":{"id":3302795,"name":"node-bunyan","full_name":"trentm/node-bunyan","owner":{"login":"trentm","id":46866,"avatar_url":"https://avatars.githubusercontent.com/u/46866?v=3","gravatar_id":"","url":"https://api.github.com/users/trentm","html_url":"https://github.com/trentm","followers_url":"https://api.github.com/users/trentm/followers","following_url":"https://api.github.com/users/trentm/following{/other_user}","gists_url":"https://api.github.com/users/trentm/gists{/gist_id}","starred_url":"https://api.github.com/users/trentm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trentm/subscriptions","organizations_url":"https://api.github.com/users/trentm/orgs","repos_url":"https://api.github.com/users/trentm/repos","events_url":"https://api.github.com/users/trentm/events{/privacy}","received_events_url":"https://api.github.com/users/trentm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/trentm/node-bunyan","description":"a simple and fast JSON logging module for node.js services","fork":false,"url":"https://api.github.com/repos/trentm/node-bunyan","forks_url":"https://api.github.com/repos/trentm/node-bunyan/forks","keys_url":"https://api.github.com/repos/trentm/node-bunyan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trentm/node-bunyan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trentm/node-bunyan/teams","hooks_url":"https://api.github.com/repos/trentm/node-bunyan/hooks","issue_events_url":"https://api.github.com/repos/trentm/node-bunyan/issues/events{/number}","events_url":"https://api.github.com/repos/trentm/node-bunyan/events","assignees_url":"https://api.github.com/repos/trentm/node-bunyan/assignees{/user}","branches_url":"https://api.github.com/repos/trentm/node-bunyan/branches{/branch}","tags_url":"https://api.github.com/repos/trentm/node-bunyan/tags","blobs_url":"https://api.github.com/repos/trentm/node-bunyan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trentm/node-bunyan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trentm/node-bunyan/git/refs{/sha}","trees_url":"https://api.github.com/repos/trentm/node-bunyan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trentm/node-bunyan/statuses/{sha}","languages_url":"https://api.github.com/repos/trentm/node-bunyan/languages","stargazers_url":"https://api.github.com/repos/trentm/node-bunyan/stargazers","contributors_url":"https://api.github.com/repos/trentm/node-bunyan/contributors","subscribers_url":"https://api.github.com/repos/trentm/node-bunyan/subscribers","subscription_url":"https://api.github.com/repos/trentm/node-bunyan/subscription","commits_url":"https://api.github.com/repos/trentm/node-bunyan/commits{/sha}","git_commits_url":"https://api.github.com/repos/trentm/node-bunyan/git/commits{/sha}","comments_url":"https://api.github.com/repos/trentm/node-bunyan/comments{/number}","issue_comment_url":"https://api.github.com/repos/trentm/node-bunyan/issues/comments{/number}","contents_url":"https://api.github.com/repos/trentm/node-bunyan/contents/{+path}","compare_url":"https://api.github.com/repos/trentm/node-bunyan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trentm/node-bunyan/merges","archive_url":"https://api.github.com/repos/trentm/node-bunyan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trentm/node-bunyan/downloads","issues_url":"https://api.github.com/repos/trentm/node-bunyan/issues{/number}","pulls_url":"https://api.github.com/repos/trentm/node-bunyan/pulls{/number}","milestones_url":"https://api.github.com/repos/trentm/node-bunyan/milestones{/number}","notifications_url":"https://api.github.com/repos/trentm/node-bunyan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trentm/node-bunyan/labels{/name}","releases_url":"https://api.github.com/repos/trentm/node-bunyan/releases{/id}","created_at":"2012-01-30T06:26:13Z","updated_at":"2015-06-02T04:13:07Z","pushed_at":"2015-06-02T05:13:18Z","git_url":"git://github.com/trentm/node-bunyan.git","ssh_url":"git@github.com:trentm/node-bunyan.git","clone_url":"https://github.com/trentm/node-bunyan.git","svn_url":"https://github.com/trentm/node-bunyan","homepage":"","size":3186,"stargazers_count":1843,"watchers_count":1843,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":139,"mirror_url":null,"open_issues_count":95,"forks":139,"open_issues":95,"watchers":1843,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/trentm/node-bunyan/pulls/260"},"html":{"href":"https://github.com/trentm/node-bunyan/pull/260"},"issue":{"href":"https://api.github.com/repos/trentm/node-bunyan/issues/260"},"comments":{"href":"https://api.github.com/repos/trentm/node-bunyan/issues/260/comments"},"review_comments":{"href":"https://api.github.com/repos/trentm/node-bunyan/pulls/260/comments"},"review_comment":{"href":"https://api.github.com/repos/trentm/node-bunyan/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/trentm/node-bunyan/pulls/260/commits"},"statuses":{"href":"https://api.github.com/repos/trentm/node-bunyan/statuses/7a922548a4247192d0154de05aae950e7061319e"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":187,"deletions":17,"changed_files":2}}