From b3c72a7c4a935e805b87ff2e1911429628ace7c5 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 4 Feb 2020 06:05:17 +0100 Subject: [PATCH] [API] expose RepoOwner on Issue responce (#10126) * add RepoOwner on issue api responce * CI.restart() --- models/issue.go | 1 + modules/structs/issue.go | 1 + templates/swagger/v1_json.tmpl | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/models/issue.go b/models/issue.go index c0be987ac9..52d22f1509 100644 --- a/models/issue.go +++ b/models/issue.go @@ -398,6 +398,7 @@ func (issue *Issue) apiFormat(e Engine) *api.Issue { apiIssue.Repo = &api.RepositoryMeta{ ID: issue.Repo.ID, Name: issue.Repo.Name, + Owner: issue.Repo.OwnerName, FullName: issue.Repo.FullName(), } diff --git a/modules/structs/issue.go b/modules/structs/issue.go index 49a7dc6d6f..eed5bb500b 100644 --- a/modules/structs/issue.go +++ b/modules/structs/issue.go @@ -30,6 +30,7 @@ type PullRequestMeta struct { type RepositoryMeta struct { ID int64 `json:"id"` Name string `json:"name"` + Owner string `json:"owner"` FullName string `json:"full_name"` } diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index ecd9639049..35c700a765 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -12350,6 +12350,10 @@ "name": { "type": "string", "x-go-name": "Name" + }, + "owner": { + "type": "string", + "x-go-name": "Owner" } }, "x-go-package": "code.gitea.io/gitea/modules/structs"