summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2018-11-27 23:52:20 +0200
committertechknowlogick <hello@techknowlogick.com>2018-11-27 16:52:20 -0500
commit08bf443016bae30690417b4835076709ef36e3b0 (patch)
treeece591d95416dd85e726dce15e0ab52872a17b06 /templates
parent294904321cb6de535237a6a156d5c4ec462bc117 (diff)
downloadgitea-08bf443016bae30690417b4835076709ef36e3b0.tar.gz
gitea-08bf443016bae30690417b4835076709ef36e3b0.zip
Implement git refs API for listing references (branches, tags and other) (#5354)
* Inital routes to git refs api * Git refs API implementation * Update swagger * Fix copyright * Make swagger happy add basic test * Fix test * Fix test again :)
Diffstat (limited to 'templates')
-rw-r--r--templates/swagger/v1_json.tmpl131
1 files changed, 131 insertions, 0 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index 8befe64f89..61ffbe13c6 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -1560,6 +1560,85 @@
}
}
},
+ "/repos/{owner}/{repo}/git/refs": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Get specified ref or filtered repository's refs",
+ "operationId": "repoListAllGitRefs",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/ReferenceList"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/repos/{owner}/{repo}/git/refs/{ref}": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Get specified ref or filtered repository's refs",
+ "operationId": "repoListGitRefs",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "part or full name of the ref",
+ "name": "ref",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/ReferenceList"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
"/repos/{owner}/{repo}/hooks": {
"get": {
"produces": [
@@ -6937,6 +7016,25 @@
},
"x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
},
+ "GitObject": {
+ "type": "object",
+ "title": "GitObject represents a Git object.",
+ "properties": {
+ "sha": {
+ "type": "string",
+ "x-go-name": "SHA"
+ },
+ "type": {
+ "type": "string",
+ "x-go-name": "Type"
+ },
+ "url": {
+ "type": "string",
+ "x-go-name": "URL"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
+ },
"Issue": {
"description": "Issue represents an issue in a repository",
"type": "object",
@@ -7526,6 +7624,24 @@
},
"x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
},
+ "Reference": {
+ "type": "object",
+ "title": "Reference represents a Git reference.",
+ "properties": {
+ "object": {
+ "$ref": "#/definitions/GitObject"
+ },
+ "ref": {
+ "type": "string",
+ "x-go-name": "Ref"
+ },
+ "url": {
+ "type": "string",
+ "x-go-name": "URL"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
+ },
"Release": {
"description": "Release represents a repository release",
"type": "object",
@@ -8177,6 +8293,21 @@
}
}
},
+ "Reference": {
+ "description": "Reference",
+ "schema": {
+ "$ref": "#/definitions/Reference"
+ }
+ },
+ "ReferenceList": {
+ "description": "ReferenceList",
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Reference"
+ }
+ }
+ },
"Release": {
"description": "Release",
"schema": {