Closed eric-nguyen-cs closed 5 months ago
I believe that Github provides a link to the Github docs for each REST endpoint in the api definition json so it would be possible to add a link to the docs for each Python endpoint function For example
async def async_get_branch( self, owner: str, repo: str, branch: str, *, headers: Optional[Dict[str, str]] = None, ) -> Response[BranchWithProtection]: """see more `https://docs.github.com/en/rest/branches/branches?apiVersion=2022-11-28#get-a-branch`""" from ..models import BasicError, BranchWithProtection url = f"/repos/{owner}/{repo}/branches/{branch}" headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} return await self._github.arequest( "GET", url, headers=exclude_unset(headers), response_model=BranchWithProtection, error_models={ "404": BasicError, }, )
I'd be willing to do the PR as well
This looks great! The docs link for each endpoint can be get from the externalDocs.url field of the schema.
externalDocs.url
I believe that Github provides a link to the Github docs for each REST endpoint in the api definition json so it would be possible to add a link to the docs for each Python endpoint function For example