diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2024-05-28 18:03:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-28 10:03:54 +0000 |
commit | de4616690f742aebc3e019fde5c73c432d543292 (patch) | |
tree | ed7259c7eb01492e930811af31011f4f89520c20 | |
parent | b6f15c7948ac3d09977350de83ec91d5789ea083 (diff) | |
download | gitea-de4616690f742aebc3e019fde5c73c432d543292.tar.gz gitea-de4616690f742aebc3e019fde5c73c432d543292.zip |
Add topics for repository API (#31127)
Fix ##31100
-rw-r--r-- | modules/structs/repo.go | 1 | ||||
-rw-r--r-- | services/convert/repository.go | 1 | ||||
-rw-r--r-- | templates/swagger/v1_json.tmpl | 7 |
3 files changed, 9 insertions, 0 deletions
diff --git a/modules/structs/repo.go b/modules/structs/repo.go index 1fe826cf89..444967c3e7 100644 --- a/modules/structs/repo.go +++ b/modules/structs/repo.go @@ -113,6 +113,7 @@ type Repository struct { // swagger:strfmt date-time MirrorUpdated time.Time `json:"mirror_updated,omitempty"` RepoTransfer *RepoTransfer `json:"repo_transfer"` + Topics []string `json:"topics"` } // CreateRepoOption options when creating repository diff --git a/services/convert/repository.go b/services/convert/repository.go index 26c591dd88..d7568e8d08 100644 --- a/services/convert/repository.go +++ b/services/convert/repository.go @@ -236,6 +236,7 @@ func innerToRepo(ctx context.Context, repo *repo_model.Repository, permissionInR MirrorInterval: mirrorInterval, MirrorUpdated: mirrorUpdated, RepoTransfer: transfer, + Topics: repo.Topics, ObjectFormatName: repo.ObjectFormatName, } } diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 34829a15fc..c552e48346 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -23804,6 +23804,13 @@ "type": "boolean", "x-go-name": "Template" }, + "topics": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Topics" + }, "updated_at": { "type": "string", "format": "date-time", |