summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-18 10:35:25 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-18 10:35:25 -0800
commit0533ae7eec0ebe7437610965ed8ddf4386723328 (patch)
tree038b0fb42ba533d91d0716ef4064abdb4b2d3ad3
parent57c121aac995ecc5c227f4a5cf32aa74c24caced (diff)
parentbb80bf3612b9fe47a4a5b11645ad494fe169f586 (diff)
downloadgitlab-ce-0533ae7eec0ebe7437610965ed8ddf4386723328.tar.gz
Merge pull request #8464 from dserodio/group-api-description
Add description attribute to group API (GET and POST)
-rw-r--r--CHANGELOG2
-rw-r--r--doc/api/groups.md4
-rw-r--r--lib/api/entities.rb2
-rw-r--r--lib/api/groups.rb2
4 files changed, 6 insertions, 4 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 9eb68042554..78851903704 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,7 +4,7 @@ v 7.8.0
- Replace highlight.js with rouge-fork rugments (Stefan Tatschner)
-
-
- -
+ - Expose description in groups API
-
-
-
diff --git a/doc/api/groups.md b/doc/api/groups.md
index 8aae4f6b1bb..e6893d71774 100644
--- a/doc/api/groups.md
+++ b/doc/api/groups.md
@@ -14,7 +14,8 @@ GET /groups
"id": 1,
"name": "Foobar Group",
"path": "foo-bar",
- "owner_id": 18
+ "owner_id": 18,
+ "description": "An interesting group"
}
]
```
@@ -45,6 +46,7 @@ Parameters:
- `name` (required) - The name of the group
- `path` (required) - The path of the group
+- `description` (optional) - The group's description
## Transfer project to group
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 2fea151aeb3..ac166ed4fba 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -65,7 +65,7 @@ module API
end
class Group < Grape::Entity
- expose :id, :name, :path, :owner_id
+ expose :id, :name, :path, :owner_id, :description
end
class GroupDetail < Group
diff --git a/lib/api/groups.rb b/lib/api/groups.rb
index bda60b3b7d5..730dfad52c8 100644
--- a/lib/api/groups.rb
+++ b/lib/api/groups.rb
@@ -47,7 +47,7 @@ module API
authenticated_as_admin!
required_attributes! [:name, :path]
- attrs = attributes_for_keys [:name, :path]
+ attrs = attributes_for_keys [:name, :path, :description]
@group = Group.new(attrs)
@group.owner = current_user