From 873db06255eae1f69644c2a0815b88c923021c8f Mon Sep 17 00:00:00 2001 From: Sebastian Ziebell Date: Wed, 27 Feb 2013 12:34:45 +0100 Subject: 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. --- lib/api/groups.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/api') 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 -- cgit v1.2.1