]> source.dussan.org Git - gitea.git/commitdiff
expose PR counter on Repo API (#9202)
author6543 <24977596+6543@users.noreply.github.com>
Fri, 29 Nov 2019 15:14:24 +0000 (16:14 +0100)
committerLunny Xiao <xiaolunwen@gmail.com>
Fri, 29 Nov 2019 15:14:24 +0000 (23:14 +0800)
models/repo.go
modules/structs/repo.go
templates/swagger/v1_json.tmpl

index 6c293da6f84bb1d04854eb85ea5e80869b549abd..cbe1ccc4f64af75db536029cc0cda89881b4a309 100644 (file)
@@ -368,6 +368,7 @@ func (repo *Repository) innerAPIFormat(e Engine, mode AccessMode, isParent bool)
                Forks:                     repo.NumForks,
                Watchers:                  repo.NumWatches,
                OpenIssues:                repo.NumOpenIssues,
+               OpenPulls:                 repo.NumOpenPulls,
                DefaultBranch:             repo.DefaultBranch,
                Created:                   repo.CreatedUnix.AsTime(),
                Updated:                   repo.UpdatedUnix.AsTime(),
index ebfb0a05869b2cae4fe7999ec4eef697aad318b5..283eddb059f7192a8fa248861b1a5cf9abb6b210 100644 (file)
@@ -67,6 +67,7 @@ type Repository struct {
        Forks         int         `json:"forks_count"`
        Watchers      int         `json:"watchers_count"`
        OpenIssues    int         `json:"open_issues_count"`
+       OpenPulls     int         `json:"open_pr_counter"`
        DefaultBranch string      `json:"default_branch"`
        Archived      bool        `json:"archived"`
        // swagger:strfmt date-time
index 338ab104e9e94be8273b026a41f4963461c52ed0..9c5db480804012a827e26c2ad1a5ffdc6133e0e2 100644 (file)
           "format": "int64",
           "x-go-name": "OpenIssues"
         },
+        "open_pr_counter": {
+          "type": "integer",
+          "format": "int64",
+          "x-go-name": "OpenPulls"
+        },
         "original_url": {
           "type": "string",
           "x-go-name": "OriginalURL"