nesquena/rabl — Issue #158: Remove the parent node for less nesting
Author: drale2k
Created: 2012-01-27 21:07:06+00:00
State: open

Hello, me again sry. I really only ask after a ton of googling and trying. I want to achieve less nesting in my output and therefore i'd like to remove the parent 'location' node, which is included for each record returned.

This is my Output at the moment:

````json
[
{
"location":{
"id":1,
"name":"Staatsoper",
"description":"Die Wiener Staatsoper.",
"city":"vienna",
"zip_code":1010,
"lat":48.204087,
"lng":16.368113,
"updated_at":"2012-01-27T15:59:29Z",
"bounding_box":[
{
"lat":48.203887,
"lng":16.368486
},
{
"lat":48.204008,
"lng":16.368824
},
{
"lat":48.204527,
"lng":16.367848
},
{
"lat":48.204484,
"lng":16.367746
}
],
"media":{
"images":[
"http://download.blender.org/peach/trailer/trailer_720p.mov"
],
"videos":[

]
}
}
},
{
"location":{
"id":7,
"name":"Stadthalle",
"description":"Die Wiener Stadthalle",
"city":"vienna",
"zip_code":1150,
"lat":48.20157,
"lng":16.332032,
"updated_at":"2012-01-27T18:40:42Z",
"bounding_box":[

],
"media":null
}
}
]
````

This is what i try to achieve:

````json
[
{
"id":1,
"name":"Staatsoper",
"description":"Die Wiener Staatsoper.",
"city":"vienna",
"zip_code":1010,
"lat":48.204087,
"lng":16.368113,
"updated_at":"2012-01-27T15:59:29Z",
"bounding_box":[
{
"lat":48.203887,
"lng":16.368486
},
{
"lat":48.204008,
"lng":16.368824
},
{
"lat":48.204527,
"lng":16.367848
},
{
"lat":48.204484,
"lng":16.367746
}
],
"media":{
"images":[
"http://download.blender.org/peach/trailer/trailer_720p.mov"
],
"videos":[

]
}
},
{
"id":7,
"name":"Stadthalle",
"description":"Die Wiener Stadthalle",
"city":"vienna",
"zip_code":1150,
"lat":48.20157,
"lng":16.332032,
"updated_at":"2012-01-27T18:40:42Z",
"bounding_box":[

],
"media":null
}
]
````