Skip to content

Commit

Permalink
expose PR counter on Repo API (#9202)
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 authored and lunny committed Nov 29, 2019
1 parent e151674 commit d7c1310
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions models/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
1 change: 1 addition & 0 deletions modules/structs/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions templates/swagger/v1_json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10329,6 +10329,11 @@
"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"
Expand Down

0 comments on commit d7c1310

Please sign in to comment.