Make GET /flavors response structure consistent

Return a JSON object instead of a JSON array as the response representation.
This is consistent with the response representation of GET /services. Further,
it allows for the possibilty of adding a top-level "links" property in the
future.

Change-Id: I64fabfb5974eb928d84f937b125d4826cc86b78a
This commit is contained in:
Shaunak Kashyap 2014-11-13 18:06:49 -08:00
parent 83cc0d6e28
commit e8213e670d
1 changed files with 3 additions and 1 deletions

View File

@ -41,7 +41,9 @@ class FlavorsController(base.Controller):
flavor_list = [
flavor_response.Model(item, pecan.request) for item in result]
return flavor_list
return {
'flavors': flavor_list
}
@pecan.expose('json')
def get_one(self, flavor_id):