{"action":"created","issue":{"url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/799","labels_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/799/labels{/name}","comments_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/799/comments","events_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/799/events","html_url":"https://github.com/rails-api/active_model_serializers/pull/799","id":56133001,"number":799,"title":"Fields option should filter linked associations","user":{"login":"donbobka","id":589057,"avatar_url":"https://avatars.githubusercontent.com/u/589057?v=3","gravatar_id":"","url":"https://api.github.com/users/donbobka","html_url":"https://github.com/donbobka","followers_url":"https://api.github.com/users/donbobka/followers","following_url":"https://api.github.com/users/donbobka/following{/other_user}","gists_url":"https://api.github.com/users/donbobka/gists{/gist_id}","starred_url":"https://api.github.com/users/donbobka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donbobka/subscriptions","organizations_url":"https://api.github.com/users/donbobka/orgs","repos_url":"https://api.github.com/users/donbobka/repos","events_url":"https://api.github.com/users/donbobka/events{/privacy}","received_events_url":"https://api.github.com/users/donbobka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-31T17:56:39Z","updated_at":"2015-02-10T18:54:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rails-api/active_model_serializers/pulls/799","html_url":"https://github.com/rails-api/active_model_serializers/pull/799","diff_url":"https://github.com/rails-api/active_model_serializers/pull/799.diff","patch_url":"https://github.com/rails-api/active_model_serializers/pull/799.patch"},"body":"This feature implements filtering of associations with option `fields`. \r\nIMHO, linked associations are like fields and they should be filtered too, when option `fields` used\r\n\r\nUnfortunately, I found nothing about it at http://jsonapi.org/format/. What do you think about it?"},"comment":{"url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/comments/73759353","html_url":"https://github.com/rails-api/active_model_serializers/pull/799#issuecomment-73759353","issue_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/799","id":73759353,"user":{"login":"donbobka","id":589057,"avatar_url":"https://avatars.githubusercontent.com/u/589057?v=3","gravatar_id":"","url":"https://api.github.com/users/donbobka","html_url":"https://github.com/donbobka","followers_url":"https://api.github.com/users/donbobka/followers","following_url":"https://api.github.com/users/donbobka/following{/other_user}","gists_url":"https://api.github.com/users/donbobka/gists{/gist_id}","starred_url":"https://api.github.com/users/donbobka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donbobka/subscriptions","organizations_url":"https://api.github.com/users/donbobka/orgs","repos_url":"https://api.github.com/users/donbobka/repos","events_url":"https://api.github.com/users/donbobka/events{/privacy}","received_events_url":"https://api.github.com/users/donbobka/received_events","type":"User","site_admin":false},"created_at":"2015-02-10T18:54:57Z","updated_at":"2015-02-10T18:54:57Z","body":"But if look at problem from another side: may be linked associations should be opt-in?\r\n\r\n```ruby\r\nclass TopicSerializer < ActiveModel::Serializer\r\n  attribute :name\r\n  belongs_to :user\r\n  has_many :posts\r\nend\r\n\r\nrender json: topic\r\n```\r\nResult\r\n\r\n```json\r\n{\r\n  \"topics\": {\r\n    \"id\": 1,\r\n    \"name\": \"Example topic\", \r\n  }\r\n}\r\n```"}}