diff options
author | Rémy Coutable <remy@rymai.me> | 2017-03-15 19:09:24 +0100 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-03-16 18:00:24 +0100 |
commit | 63360adeae3ba5b302b711c73b6439956d274cde (patch) | |
tree | f547b1bc271a1b9c0f8df616cfb1fb5c2574c43a /lib/api/commit_statuses.rb | |
parent | c9abdadd7a08f972d5a12472f9f5ac443e37a6ac (diff) | |
download | gitlab-ce-63360adeae3ba5b302b711c73b6439956d274cde.tar.gz |
Add `requirements: { id: %r{[^/]+} }` for all projects and groups namespaced API routes
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib/api/commit_statuses.rb')
-rw-r--r-- | lib/api/commit_statuses.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/api/commit_statuses.rb b/lib/api/commit_statuses.rb index 9d9f82fdb83..827a38d33da 100644 --- a/lib/api/commit_statuses.rb +++ b/lib/api/commit_statuses.rb @@ -2,7 +2,10 @@ require 'mime/types' module API class CommitStatuses < Grape::API - resource :projects do + params do + requires :id, type: String, desc: 'The ID of a project' + end + resource :projects, requirements: { id: %r{[^/]+} } do include PaginationParams before { authenticate! } @@ -11,7 +14,6 @@ module API success Entities::CommitStatus end params do - requires :id, type: String, desc: 'The ID of a project' requires :sha, type: String, desc: 'The commit hash' optional :ref, type: String, desc: 'The ref' optional :stage, type: String, desc: 'The stage' @@ -37,7 +39,6 @@ module API success Entities::CommitStatus end params do - requires :id, type: String, desc: 'The ID of a project' requires :sha, type: String, desc: 'The commit hash' requires :state, type: String, desc: 'The state of the status', values: %w(pending running success failed canceled) |