Commit 1a762415 authored by Lukas Matt's avatar Lukas Matt

Add documentation for ApiAspect.Index

parent ced5df77
......@@ -221,6 +221,45 @@ func (a ApiAspect) DeletePerson() revel.Result {
return a.RenderJSON(membership)
}
/**
* @api {get} /aspects Fetch user aspect list
* @apiName ApiAspect.Index
* @apiGroup Aspects
*
* @apiParam {String} [fields] Display only specific fields, e.g. fields=ID,Person(ID:Profile(ID:ImageUrl))
*
* @apiSuccess {String} CreatedAt Timestamp of creation
* @apiSuccess {String} UpdatedAt Timestamp of last replacment
* @apiSuccess {String} Guid Unique global ID
* @apiSuccess {Number} ID Unique database ID
* @apiSuccess {String} Name Aspect name
* @apiSuccess {Number} UserID User database ID
* @apiSuccess {Boolean} Default Default aspect
* @apiSuccess {Array} Memberships Aspect memberships
*
* @apiSuccessExample {json} Success-Response
* HTTP/1.1 200 OK
* {
"0": {
* "ID": 1,
* "CreatedAt": "2017-12-20T00:02:10Z",
* "UpdatedAt": "2017-12-20T00:02:10Z",
* "Name": "Friends",
* "UserID": 1,
* "Default": false,
* "Memberships": [...]
}
* }
*
* @apiError (Errors) {String} error Contains the recent error message
*
* @apiErrorExample {json} Unauthorized
* HTTP/1.1 401 Unauthorized
* {
* "error": "[...]"
* }
*
*/
func (a ApiAspect) Index(fields string) revel.Result {
return a.RenderJSON(
helpers.SelectStructFields(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment