requests / requests-oauthlib

OAuthlib support for Python-Requests!
https://requests-oauthlib.readthedocs.org/
ISC License
1.71k stars 421 forks source link

Fix Sphinx error for oauth1 fetch_token documentation #462

Closed JonathanHuot closed 2 years ago

JonathanHuot commented 2 years ago

Fix https://requests-oauthlib.readthedocs.io/en/v1.3.0-docs/api.html#requests_oauthlib.OAuth1Session.fetch_request_token docstring issue resulting in an absent "returns" field.

JonathanHuot commented 2 years ago

Exactly. Since the code is part of a list of params, it cannot have the same indent, else the list is considered as closed, and the parameters below (here it is :returns:) are considered as part of text block).

DocString:

 :param realm: A list of realms to request access to.
 :param \*\*request_kwargs: Optional arguments passed to ''post''
 function in ''requests.Session''
 :returns: The response in dict format. 

Results in:

image

And if we indent the param description like below:

 :param realm: A list of realms to request access to.
 :param \*\*request_kwargs: Optional arguments passed to ''post''
     function in ''requests.Session''
 :returns: The response in dict format. 

It becomes correctly formatted:

image