{"issue":{"state":"closed","created_at":"2011-11-28T20:19:09Z","updated_at":"2011-11-29T06:16:46Z","user":{"gravatar_id":"a46ff1a085b1e311e7fbe0a513d4d79f","id":29997,"url":"https://api.github.com/users/neezer","avatar_url":"https://secure.gravatar.com/avatar/a46ff1a085b1e311e7fbe0a513d4d79f?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"neezer"},"comments":5,"body":"I've a deep-nested JSON structure that I'm having trouble duplicating with RABL... the problem is that some levels require root keys while others don't.\r\n\r\nI want to do something like this:\r\n\r\n[\r\n  { first_root: {\r\n     blah: ...\r\n     another_blah: ...\r\n     nested_resources: [\r\n        {\r\n            some_other_blah: ...\r\n        }\r\n     ]\r\n  }\r\n]\r\n\r\nSo,\r\n\r\n1. The top level have no root key (just an array of objects)\r\n2. The second level (first_root) has a root key.\r\n3. The third level (nested_resources) has a root key.\r\n4. The fourth level (objects in nested_resources) have no root key (just an array of objects).\r\n\r\nHow would I do that? If I use `collection`, with include_json_root set to true, I get this:\r\n\r\n[ { root_key: [ { root_2_keys: [ { root_2_key: {} } ] } ]\r\n\r\nIf I set that to false, I get this:\r\n\r\n[ { [ {} ] } ]\r\n\r\nI want something like this:\r\n\r\n[ { root_key: [ {} ] } ]","assignee":null,"id":2372879,"labels":[],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":139,"title":"How to be selective with root elements?","closed_at":"2011-11-28T20:54:02Z","html_url":"https://github.com/nesquena/rabl/issues/139","url":"https://api.github.com/repos/nesquena/rabl/issues/139","milestone":null},"action":"created","comment":{"created_at":"2011-11-29T06:16:46Z","updated_at":"2011-11-29T06:16:46Z","user":{"gravatar_id":"e8a84c62048ccb7ee08d4fdeb6417533","id":6511,"url":"https://api.github.com/users/nesquena","avatar_url":"https://secure.gravatar.com/avatar/e8a84c62048ccb7ee08d4fdeb6417533?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"nesquena"},"body":"Very creative way to solve the issue, thanks for sharing that.","id":2916495,"url":"https://api.github.com/repos/nesquena/rabl/issues/comments/2916495"}}