diff options
author | Richard Mahn <richmahn@users.noreply.github.com> | 2019-06-08 10:31:11 -0400 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2019-06-08 17:31:11 +0300 |
commit | 8de0b0a3f06fe7879fb014d2624209e0e48455a0 (patch) | |
tree | 55a1413aa439c86749ee0af31d484675e3b4b5cc /templates/swagger | |
parent | 23a2ee3510ad1b1e7e89edc526ed394c71a8ba24 (diff) | |
download | gitea-8de0b0a3f06fe7879fb014d2624209e0e48455a0.tar.gz gitea-8de0b0a3f06fe7879fb014d2624209e0e48455a0.zip |
Fixes #2738 - Adds the /git/tags API endpoint (#7138)
* Fixes #2738 - /git/tags API
* proper URLs
* Adds function comments
* Updates swagger
* Removes newline from tag message
* Removes trailing newline from commit message
* Adds integration test
* Removed debugging
* Adds tests
* Fixes bug where multiple tags of same commit show wrong tag name
* Fix formatting
* Removes unused varaible
* Fix to annotated tag function names and response
* Update modules/git/repo_tag.go
Co-Authored-By: Lauris BH <lauris@nix.lv>
* Uses TagPrefix
* Changes per review, better error handling for getting tag and commit IDs
* Fix to getting commit ID
* Fix to getting commit ID
* Fix to getting commit ID
* Fix to getting commit ID
Diffstat (limited to 'templates/swagger')
-rw-r--r-- | templates/swagger/v1_json.tmpl | 120 |
1 files changed, 108 insertions, 12 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 0bd85fbb6e..2b40c89791 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -2036,6 +2036,46 @@ } } }, + "/repos/{owner}/{repo}/git/tags/{sha}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Gets the tag of a repository.", + "operationId": "GetTag", + "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": "sha of the tag", + "name": "sha", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/AnnotatedTag" + } + } + } + }, "/repos/{owner}/{repo}/git/trees/{sha}": { "get": { "produces": [ @@ -6762,6 +6802,57 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "AnnotatedTag": { + "description": "AnnotatedTag represents an annotated tag", + "type": "object", + "properties": { + "message": { + "type": "string", + "x-go-name": "Message" + }, + "object": { + "$ref": "#/definitions/AnnotatedTagObject" + }, + "sha": { + "type": "string", + "x-go-name": "SHA" + }, + "tag": { + "type": "string", + "x-go-name": "Tag" + }, + "tagger": { + "$ref": "#/definitions/CommitUser" + }, + "url": { + "type": "string", + "x-go-name": "URL" + }, + "verification": { + "$ref": "#/definitions/PayloadCommitVerification" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "AnnotatedTagObject": { + "description": "AnnotatedTagObject contains meta information of the tag object", + "type": "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/modules/structs" + }, "Attachment": { "description": "Attachment a generic attachment", "type": "object", @@ -9458,18 +9549,11 @@ "type": "object", "properties": { "commit": { - "type": "object", - "properties": { - "sha": { - "type": "string", - "x-go-name": "SHA" - }, - "url": { - "type": "string", - "x-go-name": "URL" - } - }, - "x-go-name": "Commit" + "$ref": "#/definitions/CommitMeta" + }, + "id": { + "type": "string", + "x-go-name": "ID" }, "name": { "type": "string", @@ -9735,6 +9819,12 @@ "AccessTokenList": { "description": "AccessTokenList represents a list of API access token." }, + "AnnotatedTag": { + "description": "AnnotatedTag", + "schema": { + "$ref": "#/definitions/AnnotatedTag" + } + }, "Attachment": { "description": "Attachment", "schema": { @@ -10056,6 +10146,12 @@ } } }, + "Tag": { + "description": "Tag", + "schema": { + "$ref": "#/definitions/Tag" + } + }, "TagList": { "description": "TagList", "schema": { |