diff options
author | Alexandru Croitor <acroitor@gitlab.com> | 2019-03-01 16:37:22 +0200 |
---|---|---|
committer | Alexandru Croitor <acroitor@gitlab.com> | 2019-03-06 13:28:42 +0200 |
commit | be3578d24585c7f330103cc546eb50416cd951d3 (patch) | |
tree | e423c5fac61e5f25e05c5cfc5f2853623f7deaa2 /lib/api/issues.rb | |
parent | ee8cb2d1b37c5c0d990a35af29be2877092eef29 (diff) | |
download | gitlab-ce-be3578d24585c7f330103cc546eb50416cd951d3.tar.gz |
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/issues.rb')
-rw-r--r-- | lib/api/issues.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb index f43f4d961d6..d59d2f5a098 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -34,7 +34,7 @@ module API # rubocop: enable CodeReuse/ActiveRecord params :issues_params do - 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 :milestone, type: String, desc: 'Milestone title' optional :order_by, type: String, values: %w[created_at updated_at], default: 'created_at', desc: 'Return issues ordered by `created_at` or `updated_at` fields.' @@ -65,7 +65,7 @@ module API optional :assignee_ids, type: Array[Integer], desc: 'The array of user IDs to assign issue' optional :assignee_id, type: Integer, desc: '[Deprecated] The ID of a user to assign issue' optional :milestone_id, type: Integer, desc: 'The ID of a milestone to assign issue' - 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 :due_date, type: String, desc: 'Date string in the format YEAR-MONTH-DAY' optional :confidential, type: Boolean, desc: 'Boolean parameter if the issue should be confidential' optional :discussion_locked, type: Boolean, desc: " Boolean parameter indicating if the issue's discussion is locked" |