diff options
author | Allen Wild <aswild@users.noreply.github.com> | 2018-08-02 04:10:02 -0400 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2018-08-02 16:10:02 +0800 |
commit | c40f5d2d4cad5fa02faa360f1cad4438f957b1d5 (patch) | |
tree | b1079fee355fb65d9350506a90a4a60e88578dd1 /templates/swagger/v1_json.tmpl | |
parent | 819f50ccd50b6f7ff320e1341cf430356d5c01fb (diff) | |
download | gitea-c40f5d2d4cad5fa02faa360f1cad4438f957b1d5.tar.gz gitea-c40f5d2d4cad5fa02faa360f1cad4438f957b1d5.zip |
api: repos/search: add parameters to control the sort order (#3964)
The backend SearchRepositoryByName function supports several sort order
options, hook these up to the /repos/search API.
New parameters for /repos/search:
'sort': alpha, created, updated, size, or id
'order': asc or desc
'sort' defaults to alpha.
'order' defaults to ascending, and is ignored if 'sort' is not specified.
The overall default behavior is unchanged (alphabetically ascending).
This partially implements issue #3963
Signed-off-by: Allen Wild <allenwild93@gmail.com>
Diffstat (limited to 'templates/swagger/v1_json.tmpl')
-rw-r--r-- | templates/swagger/v1_json.tmpl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index c1026904ee..1ea79068ac 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -985,6 +985,18 @@ "description": "if `uid` is given, search only for repos that the user owns", "name": "exclusive", "in": "query" + }, + { + "type": "string", + "description": "sort repos by attribute. Supported values are \"alpha\", \"created\", \"updated\", \"size\", and \"id\". Default is \"alpha\"", + "name": "sort", + "in": "query" + }, + { + "type": "string", + "description": "sort order, either \"asc\" (ascending) or \"desc\" (descending). Default is \"asc\", ignored if \"sort\" is not specified.", + "name": "order", + "in": "query" } ], "responses": { |