diff options
author | John L. Villalovos <john@sodarock.com> | 2022-01-22 10:47:43 -0800 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2022-01-22 10:47:43 -0800 |
commit | 1905548ec251c88bb6a2b6677940dac9c1ab7167 (patch) | |
tree | 749471d43b6a8297727c8209330c95a7d3ae0d6a /gitlab/v4/objects/merge_requests.py | |
parent | 8dfed0c362af2c5e936011fd0b488b8b05e8a8a0 (diff) | |
download | gitlab-jlvillal/arrays.tar.gz |
fix: use the [] after key names for array variablesjlvillal/arrays
1. Create a new CommaSeparatedListAttribute class. This is to indicate
types which are sent to the GitLab server as
comma-separated-strings (CSV) but we have been allowing users to
use a list-of-strings. These values are NOT array values, so
adding [] to the key name breaks them.
2. Rename ListAttribute to ArrayAttribute.
3. If a value is of type ArrayAttribute then append '[]' to the name
of the value.
4. Move processing of most GitlabAttributes into the
client.py:http_request() method. Now we convert our params into a
list of tuples so that we can have multiple identical keys but with
different values.
Fixes: #1698
Diffstat (limited to 'gitlab/v4/objects/merge_requests.py')
-rw-r--r-- | gitlab/v4/objects/merge_requests.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gitlab/v4/objects/merge_requests.py b/gitlab/v4/objects/merge_requests.py index 9a4f8c8..9f2368b 100644 --- a/gitlab/v4/objects/merge_requests.py +++ b/gitlab/v4/objects/merge_requests.py @@ -95,10 +95,10 @@ class MergeRequestManager(ListMixin, RESTManager): "deployed_after", ) _types = { - "approver_ids": types.ListAttribute, - "approved_by_ids": types.ListAttribute, - "in": types.ListAttribute, - "labels": types.ListAttribute, + "approver_ids": types.ArrayAttribute, + "approved_by_ids": types.ArrayAttribute, + "in": types.CommaSeparatedListAttribute, + "labels": types.CommaSeparatedListAttribute, } @@ -133,9 +133,9 @@ class GroupMergeRequestManager(ListMixin, RESTManager): "wip", ) _types = { - "approver_ids": types.ListAttribute, - "approved_by_ids": types.ListAttribute, - "labels": types.ListAttribute, + "approver_ids": types.ArrayAttribute, + "approved_by_ids": types.ArrayAttribute, + "labels": types.CommaSeparatedListAttribute, } @@ -455,10 +455,10 @@ class ProjectMergeRequestManager(CRUDMixin, RESTManager): "wip", ) _types = { - "approver_ids": types.ListAttribute, - "approved_by_ids": types.ListAttribute, - "iids": types.ListAttribute, - "labels": types.ListAttribute, + "approver_ids": types.ArrayAttribute, + "approved_by_ids": types.ArrayAttribute, + "iids": types.ArrayAttribute, + "labels": types.CommaSeparatedListAttribute, } def get( |