diff --git a/modules/convert/issue.go b/modules/convert/issue.go index ab1f9f1e63e..a335f6326b9 100644 --- a/modules/convert/issue.go +++ b/modules/convert/issue.go @@ -36,6 +36,7 @@ func ToAPIIssue(issue *models.Issue) *api.Issue { Body: issue.Content, Labels: ToLabelList(issue.Labels), State: issue.State(), + IsLocked: issue.IsLocked, Comments: issue.NumComments, Created: issue.CreatedUnix.AsTime(), Updated: issue.UpdatedUnix.AsTime(), diff --git a/modules/convert/pull.go b/modules/convert/pull.go index 6ff88c4d8aa..2fa22efcb38 100644 --- a/modules/convert/pull.go +++ b/modules/convert/pull.go @@ -53,6 +53,7 @@ func ToAPIPullRequest(pr *models.PullRequest) *api.PullRequest { Assignee: apiIssue.Assignee, Assignees: apiIssue.Assignees, State: apiIssue.State, + IsLocked: apiIssue.IsLocked, Comments: apiIssue.Comments, HTMLURL: pr.Issue.HTMLURL(), DiffURL: pr.Issue.DiffURL(), diff --git a/modules/structs/issue.go b/modules/structs/issue.go index eed5bb500b4..dc633dedce1 100644 --- a/modules/structs/issue.go +++ b/modules/structs/issue.go @@ -55,6 +55,7 @@ type Issue struct { // type: string // enum: open,closed State StateType `json:"state"` + IsLocked bool `json:"is_locked"` Comments int `json:"comments"` // swagger:strfmt date-time Created time.Time `json:"created_at"` diff --git a/modules/structs/pull.go b/modules/structs/pull.go index c4ec7d416a9..8dea51f2c68 100644 --- a/modules/structs/pull.go +++ b/modules/structs/pull.go @@ -21,6 +21,7 @@ type PullRequest struct { Assignee *User `json:"assignee"` Assignees []*User `json:"assignees"` State StateType `json:"state"` + IsLocked bool `json:"is_locked"` Comments int `json:"comments"` HTMLURL string `json:"html_url"` diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 4f9c4583265..1f159d64a07 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -12828,6 +12828,10 @@ "format": "int64", "x-go-name": "ID" }, + "is_locked": { + "type": "boolean", + "x-go-name": "IsLocked" + }, "labels": { "type": "array", "items": { @@ -13501,6 +13505,10 @@ "format": "int64", "x-go-name": "ID" }, + "is_locked": { + "type": "boolean", + "x-go-name": "IsLocked" + }, "labels": { "type": "array", "items": {