mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	expose PR counter on Repo API (#9202)
This commit is contained in:
		@@ -368,6 +368,7 @@ func (repo *Repository) innerAPIFormat(e Engine, mode AccessMode, isParent bool)
 | 
				
			|||||||
		Forks:                     repo.NumForks,
 | 
							Forks:                     repo.NumForks,
 | 
				
			||||||
		Watchers:                  repo.NumWatches,
 | 
							Watchers:                  repo.NumWatches,
 | 
				
			||||||
		OpenIssues:                repo.NumOpenIssues,
 | 
							OpenIssues:                repo.NumOpenIssues,
 | 
				
			||||||
 | 
							OpenPulls:                 repo.NumOpenPulls,
 | 
				
			||||||
		DefaultBranch:             repo.DefaultBranch,
 | 
							DefaultBranch:             repo.DefaultBranch,
 | 
				
			||||||
		Created:                   repo.CreatedUnix.AsTime(),
 | 
							Created:                   repo.CreatedUnix.AsTime(),
 | 
				
			||||||
		Updated:                   repo.UpdatedUnix.AsTime(),
 | 
							Updated:                   repo.UpdatedUnix.AsTime(),
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -67,6 +67,7 @@ type Repository struct {
 | 
				
			|||||||
	Forks         int         `json:"forks_count"`
 | 
						Forks         int         `json:"forks_count"`
 | 
				
			||||||
	Watchers      int         `json:"watchers_count"`
 | 
						Watchers      int         `json:"watchers_count"`
 | 
				
			||||||
	OpenIssues    int         `json:"open_issues_count"`
 | 
						OpenIssues    int         `json:"open_issues_count"`
 | 
				
			||||||
 | 
						OpenPulls     int         `json:"open_pr_counter"`
 | 
				
			||||||
	DefaultBranch string      `json:"default_branch"`
 | 
						DefaultBranch string      `json:"default_branch"`
 | 
				
			||||||
	Archived      bool        `json:"archived"`
 | 
						Archived      bool        `json:"archived"`
 | 
				
			||||||
	// swagger:strfmt date-time
 | 
						// swagger:strfmt date-time
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10329,6 +10329,11 @@
 | 
				
			|||||||
          "format": "int64",
 | 
					          "format": "int64",
 | 
				
			||||||
          "x-go-name": "OpenIssues"
 | 
					          "x-go-name": "OpenIssues"
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					        "open_pr_counter": {
 | 
				
			||||||
 | 
					          "type": "integer",
 | 
				
			||||||
 | 
					          "format": "int64",
 | 
				
			||||||
 | 
					          "x-go-name": "OpenPulls"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
        "original_url": {
 | 
					        "original_url": {
 | 
				
			||||||
          "type": "string",
 | 
					          "type": "string",
 | 
				
			||||||
          "x-go-name": "OriginalURL"
 | 
					          "x-go-name": "OriginalURL"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user