summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2019-11-30 20:28:47 +0100
committertechknowlogick <techknowlogick@gitea.io>2019-11-30 14:28:47 -0500
commit7c6f2e27becb7ab43fe266d2882a0d80977c2ef7 (patch)
tree439fc52d09688996e7306e4ac17a467ffd2ea8c4
parent61c59bd69584864ae6e8acb2590818d96c230bfb (diff)
downloadgitea-7c6f2e27becb7ab43fe266d2882a0d80977c2ef7.tar.gz
gitea-7c6f2e27becb7ab43fe266d2882a0d80977c2ef7.zip
Add release_counter to Repo API (#9214)
-rw-r--r--models/repo.go1
-rw-r--r--modules/structs/repo.go1
-rw-r--r--templates/swagger/v1_json.tmpl5
3 files changed, 7 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go
index eec9065359..347c909579 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -368,6 +368,7 @@ func (repo *Repository) innerAPIFormat(e Engine, mode AccessMode, isParent bool)
Watchers: repo.NumWatches,
OpenIssues: repo.NumOpenIssues,
OpenPulls: repo.NumOpenPulls,
+ Releases: repo.NumReleases,
DefaultBranch: repo.DefaultBranch,
Created: repo.CreatedUnix.AsTime(),
Updated: repo.UpdatedUnix.AsTime(),
diff --git a/modules/structs/repo.go b/modules/structs/repo.go
index 283eddb059..f148854b55 100644
--- a/modules/structs/repo.go
+++ b/modules/structs/repo.go
@@ -68,6 +68,7 @@ type Repository struct {
Watchers int `json:"watchers_count"`
OpenIssues int `json:"open_issues_count"`
OpenPulls int `json:"open_pr_counter"`
+ Releases int `json:"release_counter"`
DefaultBranch string `json:"default_branch"`
Archived bool `json:"archived"`
// swagger:strfmt date-time
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index 9c5db48080..1d8cd36858 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -10351,6 +10351,11 @@
"type": "boolean",
"x-go-name": "Private"
},
+ "release_counter": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "Releases"
+ },
"size": {
"type": "integer",
"format": "int64",