summaryrefslogtreecommitdiff
path: root/lib/api/repositories.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/repositories.rb')
-rw-r--r--lib/api/repositories.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/api/repositories.rb b/lib/api/repositories.rb
index 4c7cc6be8b6..cef72d898e6 100644
--- a/lib/api/repositories.rb
+++ b/lib/api/repositories.rb
@@ -99,11 +99,17 @@ module API
optional :recursive, type: Boolean, default: false, desc: 'Used to get a recursive tree'
use :pagination
- optional :pagination, type: String, values: %w(legacy keyset), default: 'legacy', desc: 'Specify the pagination method'
+ optional :pagination, type: String, values: %w(legacy keyset none), default: 'legacy', desc: 'Specify the pagination method ("none" is only valid if "recursive" is true)'
- given pagination: -> (value) { value == 'keyset' } do
+ given pagination: ->(value) { value == 'keyset' } do
optional :page_token, type: String, desc: 'Record from which to start the keyset pagination'
end
+
+ given pagination: ->(value) { value == 'none' } do
+ given recursive: ->(value) { value == false } do
+ validates([:pagination], except_values: { value: 'none', message: 'cannot be "none" unless "recursive" is true' })
+ end
+ end
end
get ':id/repository/tree', urgency: :low do
tree_finder = ::Repositories::TreeFinder.new(user_project, declared_params(include_missing: false))