diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2019-01-13 13:12:17 +0100 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2019-01-13 17:20:34 +0100 |
commit | 4bd027aac41c41f7e22af93c7be0058d2faf7fb4 (patch) | |
tree | 314b738f699f5138d91b79841a53bd17f0e62cc5 /docs/api-usage.rst | |
parent | 89679ce5ee502e57dbe7cec2b78f4f70b85fd3a5 (diff) | |
download | gitlab-no-param-conflicts.tar.gz |
fix(api): avoid parameter conflicts with python and gitlabno-param-conflicts
Provide another way to send data to gitlab with a new `query_parameters`
argument. This parameter can be used to explicitly define the dict of
items to send to the server, so that **kwargs are only used to specify
python-gitlab specific parameters.
Closes #566
Closes #629
Diffstat (limited to 'docs/api-usage.rst')
-rw-r--r-- | docs/api-usage.rst | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/api-usage.rst b/docs/api-usage.rst index a5afbda..8ab252c 100644 --- a/docs/api-usage.rst +++ b/docs/api-usage.rst @@ -118,6 +118,25 @@ Some objects also provide managers to access related GitLab resources: project = gl.projects.get(1) issues = project.issues.list() +python-gitlab allows to send any data to the GitLab server when making queries. +In case of invalid or missing arguments python-gitlab will raise an exception +with the GitLab server error message: + +.. code-block:: python + + >>> gl.projects.list(sort='invalid value') + ... + GitlabListError: 400: sort does not have a valid value + +You can use the ``query_parameters`` argument to send arguments that would +conflict with python or python-gitlab when using them as kwargs: + +.. code-block:: python + + gl.user_activities.list(from='2019-01-01') ## invalid + + gl.user_activities.list(query_parameters={'from': '2019-01-01'}) # OK + Gitlab Objects ============== |