From 7c6f2e27becb7ab43fe266d2882a0d80977c2ef7 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 30 Nov 2019 20:28:47 +0100 Subject: [PATCH] Add release_counter to Repo API (#9214) --- models/repo.go | 1 + modules/structs/repo.go | 1 + templates/swagger/v1_json.tmpl | 5 +++++ 3 files changed, 7 insertions(+) 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",