diff --git a/modules/structs/repo.go b/modules/structs/repo.go index 6a2ba4836bb93..3974c4db3ab1c 100644 --- a/modules/structs/repo.go +++ b/modules/structs/repo.go @@ -63,6 +63,7 @@ type Repository struct { Language string `json:"language"` LanguagesURL string `json:"languages_url"` HTMLURL string `json:"html_url"` + URL string `json:"url"` Link string `json:"link"` SSHURL string `json:"ssh_url"` CloneURL string `json:"clone_url"` diff --git a/services/convert/repository.go b/services/convert/repository.go index 6f77b4932e4fe..71038cd0629cb 100644 --- a/services/convert/repository.go +++ b/services/convert/repository.go @@ -181,6 +181,7 @@ func innerToRepo(ctx context.Context, repo *repo_model.Repository, permissionInR Parent: parent, Mirror: repo.IsMirror, HTMLURL: repo.HTMLURL(), + URL: repoAPIURL, SSHURL: cloneLink.SSH, CloneURL: cloneLink.HTTPS, OriginalURL: repo.SanitizedOriginalURL(), diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index a9a69bc82a9ea..abe579ac826c1 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -22114,6 +22114,10 @@ "format": "date-time", "x-go-name": "Updated" }, + "url": { + "type": "string", + "x-go-name": "URL" + }, "watchers_count": { "type": "integer", "format": "int64",