flask-restful/flask-restful — pull request #349 by Ch00k (2014-11-26 09:26:04+00:00)
Title: Add an option to envelope marshaled objects

This adds a possibility to wrap the resulting marshaled object in an envelope, like this:
```
{
"imdb_data": {
"country": "UK, USA, Canada, China",
"director": "Sergey Bodrov",
"genre": "Adventure, Family, Fantasy",
"id": 1121096,
"rating": null,
"title": "Seventh Son"
}
}
```

While initially it was possible to work around this using `marshal` function (`return {'imdb_data': marshal(data, fields)}`), it was not possible to achieve this result using `marshal_with` decorator. Change in this PR adds an `envelope` kwarg to both the function and the decorator.