{"action":"created","issue":{"url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/1047","labels_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/1047/labels{/name}","comments_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/1047/comments","events_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/1047/events","html_url":"https://github.com/rails-api/active_model_serializers/pull/1047","id":100286581,"number":1047,"title":"root option in render json is not working","user":{"login":"PratheepV","id":628092,"avatar_url":"https://avatars.githubusercontent.com/u/628092?v=3","gravatar_id":"","url":"https://api.github.com/users/PratheepV","html_url":"https://github.com/PratheepV","followers_url":"https://api.github.com/users/PratheepV/followers","following_url":"https://api.github.com/users/PratheepV/following{/other_user}","gists_url":"https://api.github.com/users/PratheepV/gists{/gist_id}","starred_url":"https://api.github.com/users/PratheepV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PratheepV/subscriptions","organizations_url":"https://api.github.com/users/PratheepV/orgs","repos_url":"https://api.github.com/users/PratheepV/repos","events_url":"https://api.github.com/users/PratheepV/events{/privacy}","received_events_url":"https://api.github.com/users/PratheepV/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rails-api/active_model_serializers/labels/0.10.x","name":"0.10.x","color":"bfd4f2"},{"url":"https://api.github.com/repos/rails-api/active_model_serializers/labels/Needs%20Submitter%20Response","name":"Needs Submitter Response","color":"eb6420"}],"state":"closed","locked":false,"assignee":{"login":"joaomdmoura","id":667063,"avatar_url":"https://avatars.githubusercontent.com/u/667063?v=3","gravatar_id":"","url":"https://api.github.com/users/joaomdmoura","html_url":"https://github.com/joaomdmoura","followers_url":"https://api.github.com/users/joaomdmoura/followers","following_url":"https://api.github.com/users/joaomdmoura/following{/other_user}","gists_url":"https://api.github.com/users/joaomdmoura/gists{/gist_id}","starred_url":"https://api.github.com/users/joaomdmoura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joaomdmoura/subscriptions","organizations_url":"https://api.github.com/users/joaomdmoura/orgs","repos_url":"https://api.github.com/users/joaomdmoura/repos","events_url":"https://api.github.com/users/joaomdmoura/events{/privacy}","received_events_url":"https://api.github.com/users/joaomdmoura/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-08-11T10:48:21Z","updated_at":"2015-09-22T09:23:04Z","closed_at":"2015-08-13T05:22:56Z","pull_request":{"url":"https://api.github.com/repos/rails-api/active_model_serializers/pulls/1047","html_url":"https://github.com/rails-api/active_model_serializers/pull/1047","diff_url":"https://github.com/rails-api/active_model_serializers/pull/1047.diff","patch_url":"https://github.com/rails-api/active_model_serializers/pull/1047.patch"},"body":"Bug #1046 .\r\n\r\nWhen I try to override the root option while rendering its not working.\r\n\r\n```ruby\r\nrender json: current_user, root: :session\r\n```\r\nGetting the response as \r\n\r\n```ruby\r\n{ user: { id:1, name:\"Albert\", email: {albert@abc.xyz} } }\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/comments/142224361","html_url":"https://github.com/rails-api/active_model_serializers/pull/1047#issuecomment-142224361","issue_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/1047","id":142224361,"user":{"login":"PratheepV","id":628092,"avatar_url":"https://avatars.githubusercontent.com/u/628092?v=3","gravatar_id":"","url":"https://api.github.com/users/PratheepV","html_url":"https://github.com/PratheepV","followers_url":"https://api.github.com/users/PratheepV/followers","following_url":"https://api.github.com/users/PratheepV/following{/other_user}","gists_url":"https://api.github.com/users/PratheepV/gists{/gist_id}","starred_url":"https://api.github.com/users/PratheepV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PratheepV/subscriptions","organizations_url":"https://api.github.com/users/PratheepV/orgs","repos_url":"https://api.github.com/users/PratheepV/repos","events_url":"https://api.github.com/users/PratheepV/events{/privacy}","received_events_url":"https://api.github.com/users/PratheepV/received_events","type":"User","site_admin":false},"created_at":"2015-09-22T09:23:03Z","updated_at":"2015-09-22T09:23:03Z","body":"@joaomdmoura , root options is not working for array serializers. Meaning if we have the \r\n\r\n```ruby\r\nrender status: 200,\r\n        json: items, root: :apples\r\n```\r\nGetting the response as \r\n\r\n```javscript\r\n  {\"\": [ {id: 1 , color: 'red'}]}\r\n```\r\n\r\nI tried using json_key in serializer also. \r\n\r\nI am using 0.10.0.rc3\r\n\r\n"}}