From 40550132452948151b4dd9684e631a760ac8141f Mon Sep 17 00:00:00 2001 From: Matt Prahl Date: Jun 11 2017 13:49:46 +0000 Subject: [PATCH 1/2] Fix API documentation RST syntax errors --- diff --git a/pagure/api/issue.py b/pagure/api/issue.py index c8eccd7..a561779 100644 --- a/pagure/api/issue.py +++ b/pagure/api/issue.py @@ -654,16 +654,16 @@ def api_change_status_issue(repo, issueid, username=None, namespace=None): Input ^^^^^ - +----------------- +---------+--------------+------------------------+ + +------------------+---------+--------------+------------------------+ | Key | Type | Optionality | Description | +==================+=========+==============+========================+ | ``close_status`` | string | Optional | The close status of | | | | | the issue | - +----------------- +---------+--------------+------------------------+ + +------------------+---------+--------------+------------------------+ | ``status`` | string | Mandatory | The new status of the | | | | | issue, can be 'Open' or| | | | | 'Closed' | - +----------------- +---------+--------------+------------------------+ + +------------------+---------+--------------+------------------------+ Sample response ^^^^^^^^^^^^^^^ @@ -758,7 +758,7 @@ def api_change_status_issue(repo, issueid, username=None, namespace=None): def api_change_milestone_issue(repo, issueid, username=None, namespace=None): """ Change issue milestone - ------------------- + ---------------------- Change the milestone of an issue. :: @@ -774,7 +774,7 @@ def api_change_milestone_issue(repo, issueid, username=None, namespace=None): Input ^^^^^ - +----------------- +---------+--------------+------------------------+ + +------------------+---------+--------------+------------------------+ | Key | Type | Optionality | Description | +==================+=========+==============+========================+ | ``milestone`` | string | Optional | The new milestone of | @@ -782,7 +782,7 @@ def api_change_milestone_issue(repo, issueid, username=None, namespace=None): | | | | of defined milestones | | | | | or empty to unset the | | | | | milestone | - +----------------- +---------+--------------+------------------------+ + +------------------+---------+--------------+------------------------+ Sample response ^^^^^^^^^^^^^^^ @@ -1137,12 +1137,12 @@ def api_update_custom_field( Input ^^^^^ - +----------------- +---------+--------------+-------------------------+ + +------------------+---------+--------------+-------------------------+ | Key | Type | Optionality | Description | +==================+=========+==============+=========================+ | ``value`` | string | Optional | The new value of the | | | | | custom field of interest| - +----------------- +---------+--------------+-------------------------+ + +------------------+---------+--------------+-------------------------+ Sample response ^^^^^^^^^^^^^^^ From 398dcf88fac272c810bcbdcd2a50237710de2df5 Mon Sep 17 00:00:00 2001 From: Matt Prahl Date: Jun 11 2017 13:49:46 +0000 Subject: [PATCH 2/2] Add missing docs in the API --- diff --git a/pagure/api/__init__.py b/pagure/api/__init__.py index 6dab185..2d20891 100644 --- a/pagure/api/__init__.py +++ b/pagure/api/__init__.py @@ -430,8 +430,13 @@ def api(): ''' Display the api information page. ''' api_project_doc = load_doc(project.api_project) api_projects_doc = load_doc(project.api_projects) + api_project_watchers_doc = load_doc(project.api_project_watchers) api_git_tags_doc = load_doc(project.api_git_tags) api_project_git_urls_doc = load_doc(project.api_project_git_urls) + api_git_branches_doc = load_doc(project.api_git_branches) + api_new_project_doc = load_doc(project.api_new_project) + api_modify_project_doc = load_doc(project.api_modify_project) + api_fork_project_doc = load_doc(project.api_fork_project) issues = [] if pagure.APP.config.get('ENABLE_TICKETS', True): @@ -459,9 +464,6 @@ def api(): fork.api_pull_request_add_comment) api_pull_request_add_flag_doc = load_doc(fork.api_pull_request_add_flag) - api_new_project_doc = load_doc(project.api_new_project) - api_modify_project_doc = load_doc(project.api_modify_project) - api_version_doc = load_doc(api_version) api_users_doc = load_doc(api_users) api_view_user_doc = load_doc(user.api_view_user) @@ -495,7 +497,10 @@ def api(): api_project_doc, api_projects_doc, api_git_tags_doc, - api_project_git_urls_doc + api_project_git_urls_doc, + api_project_watchers_doc, + api_git_branches_doc, + api_fork_project_doc ], issues=issues, requests=[ diff --git a/pagure/api/project.py b/pagure/api/project.py index cee5ef4..57322b4 100644 --- a/pagure/api/project.py +++ b/pagure/api/project.py @@ -204,8 +204,8 @@ def api_project_git_urls(repo, username=None, namespace=None): @api_method def api_git_branches(repo, username=None, namespace=None): ''' - List all the branches of a git repo - ----------------------------------- + List project branches + --------------------- List the branches associated with a Pagure git repository ::