Skip to content

Commit 683ce72

Browse files
JohnVillalovosnejch
authored andcommitted
docs: add FAQ about conflicting parameters
We have received multiple issues lately about this. Add it to the FAQ.
1 parent 1ed8d6c commit 683ce72

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

docs/api-usage.rst

+5
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ with the GitLab server error message:
162162
...
163163
GitlabListError: 400: sort does not have a valid value
164164
165+
.. _conflicting_parameters:
166+
167+
Conflicting Parameters
168+
======================
169+
165170
You can use the ``query_parameters`` argument to send arguments that would
166171
conflict with python or python-gitlab when using them as kwargs:
167172

docs/faq.rst

+20
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,23 @@ access an attribute that is shadowed by python-gitlab's own methods or managers.
7878

7979
You can use the object's ``attributes`` dictionary to access it directly instead.
8080
See the :ref:`objects` section for more details on how attributes are exposed.
81+
82+
.. _conflicting_parameters_faq:
83+
84+
I cannot use the parameter ``path`` (or some other parameter) as it conflicts with the library
85+
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
86+
87+
``path`` is used by the python-gitlab library and cannot be used as a parameter
88+
if wanting to send it to the GitLab instance. You can use the
89+
``query_parameters`` argument to send arguments that would conflict with python
90+
or python-gitlab when using them as kwargs:
91+
92+
.. code-block:: python
93+
94+
## invalid, as ``path`` is interpreted by python-gitlab as the Path or full
95+
## URL to query ('/projects' or 'http://whatever/v4/api/projects')
96+
project.commits.list(path='some_file_path', iterator=True)
97+
98+
project.commits.list(query_parameters={'path': 'some_file_path'}, iterator=True) # OK
99+
100+
See :ref:`Conflicting Parameters <conflicting_parameters>` for more information.

0 commit comments

Comments
 (0)