]> source.dussan.org Git - gitea.git/commitdiff
Add release_counter to Repo API (#9214)
author6543 <6543@obermui.de>
Sat, 30 Nov 2019 19:28:47 +0000 (20:28 +0100)
committertechknowlogick <techknowlogick@gitea.io>
Sat, 30 Nov 2019 19:28:47 +0000 (14:28 -0500)
models/repo.go
modules/structs/repo.go
templates/swagger/v1_json.tmpl

index eec906535941d14ee61cff382c3feca1bed9a990..347c9095794f3948adab9a5e1636772432315094 100644 (file)
@@ -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(),
index 283eddb059f7192a8fa248861b1a5cf9abb6b210..f148854b55d14f7ed1f9ca74ab978b0d5c64441b 100644 (file)
@@ -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
index 9c5db480804012a827e26c2ad1a5ffdc6133e0e2..1d8cd3685876f48c23c4828db6663c6d22c2fd11 100644 (file)
           "type": "boolean",
           "x-go-name": "Private"
         },
+        "release_counter": {
+          "type": "integer",
+          "format": "int64",
+          "x-go-name": "Releases"
+        },
         "size": {
           "type": "integer",
           "format": "int64",