summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-27 12:34:45 +0100
committerSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-27 12:34:45 +0100
commit873db06255eae1f69644c2a0815b88c923021c8f (patch)
tree4eb4f79fa60af18bb298a2515c527a86081f274f /lib/api
parente119b0a0cb33b1b7f2dafcf17c2a94af40aed833 (diff)
downloadgitlab-ce-873db06255eae1f69644c2a0815b88c923021c8f.tar.gz
API: groups documentation updated, functions return different status codes
Updates the API documentation of groups with infos to return codes. The function calls in the groups API have updated documentation and return `400 Bad Request` status code if a required attribute is missing.
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/groups.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb
index a67caef0bc5..3f213073f80 100644
--- a/lib/api/groups.rb
+++ b/lib/api/groups.rb
@@ -6,6 +6,9 @@ module Gitlab
resource :groups do
# Get a groups list
#
+ # Parameters
+ # page (optional) - The page number of the groups list
+ # per_page (optional) - The number of elements per page
# Example Request:
# GET /groups
get do
@@ -20,12 +23,16 @@ module Gitlab
# Create group. Available only for admin
#
# Parameters:
- # name (required) - Name
- # path (required) - Path
+ # name (required) - The name of the group
+ # path (required) - The path of the group
# Example Request:
# POST /groups
post do
authenticated_as_admin!
+
+ bad_request!(:name) unless params[:name].present?
+ bad_request!(:path) unless params[:path].present?
+
attrs = attributes_for_keys [:name, :path]
@group = Group.new(attrs)
@group.owner = current_user