diff options
author | Alexandru Croitor <acroitor@gitlab.com> | 2019-03-01 17:37:22 +0300 |
---|---|---|
committer | Alexandru Croitor <acroitor@gitlab.com> | 2019-03-06 14:28:42 +0300 |
commit | be3578d24585c7f330103cc546eb50416cd951d3 (patch) | |
tree | e423c5fac61e5f25e05c5cfc5f2853623f7deaa2 /lib/api/merge_requests.rb | |
parent | ee8cb2d1b37c5c0d990a35af29be2877092eef29 (diff) |
Add array support for labels
* Support label parameter as comma separated and array of strings
for merge requests and issues api endpoints
Diffstat (limited to 'lib/api/merge_requests.rb')
-rw-r--r-- | lib/api/merge_requests.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb index 2e794076a43..b2a2aa8837d 100644 --- a/lib/api/merge_requests.rb +++ b/lib/api/merge_requests.rb @@ -95,7 +95,7 @@ module API optional :sort, type: String, values: %w[asc desc], default: 'desc', desc: 'Return merge requests sorted in `asc` or `desc` order.' optional :milestone, type: String, desc: 'Return merge requests for a specific milestone' - optional :labels, type: String, desc: 'Comma-separated list of label names' + optional :labels, type: Array[String], coerce_with: Validations::Types::LabelsList.coerce, desc: 'Comma-separated list of label names' optional :created_after, type: DateTime, desc: 'Return merge requests created after the specified time' optional :created_before, type: DateTime, desc: 'Return merge requests created before the specified time' optional :updated_after, type: DateTime, desc: 'Return merge requests updated after the specified time' @@ -179,7 +179,7 @@ module API optional :description, type: String, desc: 'The description of the merge request' optional :assignee_id, type: Integer, desc: 'The ID of a user to assign the merge request' optional :milestone_id, type: Integer, desc: 'The ID of a milestone to assign the merge request' - optional :labels, type: String, coerce_with: ->(val) { val.is_a?(Array) ? val.join(', ') : val }, desc: 'Comma-separated list of label names' + optional :labels, type: Array[String], coerce_with: Validations::Types::LabelsList.coerce, desc: 'Comma-separated list of label names' optional :remove_source_branch, type: Boolean, desc: 'Remove source branch when merging' optional :allow_collaboration, type: Boolean, desc: 'Allow commits from members who can merge to the target branch' optional :allow_maintainer_to_push, type: Boolean, as: :allow_collaboration, desc: '[deprecated] See allow_collaboration' |