From 08ee177d6f247d1f8aa43a91e89469434526aabe Mon Sep 17 00:00:00 2001 From: Jarka Kadlecova Date: Tue, 21 Feb 2017 15:12:32 +0100 Subject: API project create: Make name or path required --- lib/api/projects.rb | 3 ++- lib/api/v3/projects.rb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/api') diff --git a/lib/api/projects.rb b/lib/api/projects.rb index b89bddc7e29..c97b056ae56 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -94,8 +94,9 @@ module API success Entities::Project end params do - requires :name, type: String, desc: 'The name of the project' + optional :name, type: String, desc: 'The name of the project' optional :path, type: String, desc: 'The path of the repository' + at_least_one_of :name, :path use :optional_params use :create_params end diff --git a/lib/api/v3/projects.rb b/lib/api/v3/projects.rb index c3821555452..23d4a692477 100644 --- a/lib/api/v3/projects.rb +++ b/lib/api/v3/projects.rb @@ -172,8 +172,9 @@ module API success ::API::Entities::Project end params do - requires :name, type: String, desc: 'The name of the project' + optional :name, type: String, desc: 'The name of the project' optional :path, type: String, desc: 'The path of the repository' + at_least_one_of :name, :path use :optional_params use :create_params end -- cgit v1.2.3