diff options
author | 6543 <6543@obermui.de> | 2021-06-23 23:08:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-23 17:08:47 -0400 |
commit | eb324a9402878a13029116bafa8ccce527796522 (patch) | |
tree | 8ad442182f440e9acfd4e929a30919d9796fb3ea /routers/api/v1/api.go | |
parent | 08f4b3f31288bc4e12e94f00c7d88583ab04dd2e (diff) | |
download | gitea-eb324a9402878a13029116bafa8ccce527796522.tar.gz gitea-eb324a9402878a13029116bafa8ccce527796522.zip |
[API] Add repoGetTag (#16166)
* GetTag -> GetAnnotatedTag
* API: Add repoGetTag
* fix swagger docs
* support "/" as tag name char
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'routers/api/v1/api.go')
-rw-r--r-- | routers/api/v1/api.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 87db804dcb..c6b4ff04de 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -779,8 +779,9 @@ func Routes() *web.Route { }, reqToken(), reqAdmin()) m.Group("/tags", func() { m.Get("", repo.ListTags) + m.Get("/*", repo.GetTag) m.Post("", reqRepoWriter(models.UnitTypeCode), bind(api.CreateTagOption{}), repo.CreateTag) - m.Delete("/{tag}", repo.DeleteTag) + m.Delete("/*", repo.DeleteTag) }, reqRepoReader(models.UnitTypeCode), context.ReferencesGitRepo(true)) m.Group("/keys", func() { m.Combo("").Get(repo.ListDeployKeys). @@ -945,7 +946,7 @@ func Routes() *web.Route { m.Get("/refs/*", repo.GetGitRefs) m.Get("/trees/{sha}", context.RepoRefForAPI, repo.GetTree) m.Get("/blobs/{sha}", context.RepoRefForAPI, repo.GetBlob) - m.Get("/tags/{sha}", context.RepoRefForAPI, repo.GetTag) + m.Get("/tags/{sha}", context.RepoRefForAPI, repo.GetAnnotatedTag) }, reqRepoReader(models.UnitTypeCode)) m.Group("/contents", func() { m.Get("", repo.GetContentsList) |