{"action":"created","issue":{"url":"https://api.github.com/repos/RestPack/restpack_serializer/issues/138","repository_url":"https://api.github.com/repos/RestPack/restpack_serializer","labels_url":"https://api.github.com/repos/RestPack/restpack_serializer/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/RestPack/restpack_serializer/issues/138/comments","events_url":"https://api.github.com/repos/RestPack/restpack_serializer/issues/138/events","html_url":"https://github.com/RestPack/restpack_serializer/pull/138","id":157674083,"number":138,"title":"add support for @context[:attribute_whitelist] and @context[:attribute_blacklist]","user":{"login":"GavinJoyce","id":2526,"avatar_url":"https://avatars.githubusercontent.com/u/2526?v=3","gravatar_id":"","url":"https://api.github.com/users/GavinJoyce","html_url":"https://github.com/GavinJoyce","followers_url":"https://api.github.com/users/GavinJoyce/followers","following_url":"https://api.github.com/users/GavinJoyce/following{/other_user}","gists_url":"https://api.github.com/users/GavinJoyce/gists{/gist_id}","starred_url":"https://api.github.com/users/GavinJoyce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GavinJoyce/subscriptions","organizations_url":"https://api.github.com/users/GavinJoyce/orgs","repos_url":"https://api.github.com/users/GavinJoyce/repos","events_url":"https://api.github.com/users/GavinJoyce/events{/privacy}","received_events_url":"https://api.github.com/users/GavinJoyce/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-31T13:39:42Z","updated_at":"2016-05-31T14:35:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/RestPack/restpack_serializer/pulls/138","html_url":"https://github.com/RestPack/restpack_serializer/pull/138","diff_url":"https://github.com/RestPack/restpack_serializer/pull/138.diff","patch_url":"https://github.com/RestPack/restpack_serializer/pull/138.patch"},"body":"/cc @lorcan\r\n\r\nThis adds support for `@context[:attribute_whitelist]` and `@context[:attribute_blacklist]` which can be used as follows:\r\n\r\n```ruby\r\nserializer.as_json(person, { attribute_whitelist: [:name, :description] }\r\n=> { name: 'Alex Joyce', description: 'A little dude' }\r\n```\r\n```ruby\r\nserializer.as_json(person, { attribute_blacklist: [:name, :description] }\r\n=> { id: '123' }\r\n```\r\n\r\nThis will allow us to easily create custom endpoints such as the following:\r\n\r\n`app.json?exclude=plans,browser_locales` and\r\n`app.json?include=plans,browser_locales`\r\n\r\nThese will allow our ember app to request specific payload shapes on boot and will allow us to build clever service workers which only request data as needed"},"comment":{"url":"https://api.github.com/repos/RestPack/restpack_serializer/issues/comments/222707864","html_url":"https://github.com/RestPack/restpack_serializer/pull/138#issuecomment-222707864","issue_url":"https://api.github.com/repos/RestPack/restpack_serializer/issues/138","id":222707864,"user":{"login":"lorcan","id":401983,"avatar_url":"https://avatars.githubusercontent.com/u/401983?v=3","gravatar_id":"","url":"https://api.github.com/users/lorcan","html_url":"https://github.com/lorcan","followers_url":"https://api.github.com/users/lorcan/followers","following_url":"https://api.github.com/users/lorcan/following{/other_user}","gists_url":"https://api.github.com/users/lorcan/gists{/gist_id}","starred_url":"https://api.github.com/users/lorcan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorcan/subscriptions","organizations_url":"https://api.github.com/users/lorcan/orgs","repos_url":"https://api.github.com/users/lorcan/repos","events_url":"https://api.github.com/users/lorcan/events{/privacy}","received_events_url":"https://api.github.com/users/lorcan/received_events","type":"User","site_admin":false},"created_at":"2016-05-31T14:35:28Z","updated_at":"2016-05-31T14:35:28Z","body":"Great, :shipit: "}}
{"actor":{"display_login":"lorcan"}}