Skip to content

Commit 211731c

Browse files
committed
Clarify owner and parent field descriptions in response/request models
1 parent 3aacd7b commit 211731c

File tree

6 files changed

+307
-295
lines changed

6 files changed

+307
-295
lines changed

modules/structs/issue.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ type PullRequestMeta struct {
3535

3636
// RepositoryMeta basic repository information
3737
type RepositoryMeta struct {
38-
ID int64 `json:"id"`
39-
Name string `json:"name"`
38+
ID int64 `json:"id"`
39+
Name string `json:"name"`
40+
// username of the user or organization owning the repository
4041
Owner string `json:"owner"`
4142
FullName string `json:"full_name"`
4243
}
@@ -264,7 +265,8 @@ func (it IssueTemplate) Type() IssueTemplateType {
264265
type IssueMeta struct {
265266
Index int64 `json:"index"`
266267
Owner string `json:"owner"`
267-
Name string `json:"repo"`
268+
// name of the repo
269+
Name string `json:"repo"`
268270
}
269271

270272
// LockIssueOption options to lock an issue

modules/structs/issue_stopwatch.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ import (
1010
// StopWatch represent a running stopwatch
1111
type StopWatch struct {
1212
// swagger:strfmt date-time
13-
Created time.Time `json:"created"`
14-
Seconds int64 `json:"seconds"`
15-
Duration string `json:"duration"`
16-
IssueIndex int64 `json:"issue_index"`
17-
IssueTitle string `json:"issue_title"`
18-
RepoOwnerName string `json:"repo_owner_name"`
19-
RepoName string `json:"repo_name"`
13+
Created time.Time `json:"created"`
14+
Seconds int64 `json:"seconds"`
15+
Duration string `json:"duration"`
16+
IssueIndex int64 `json:"issue_index"`
17+
IssueTitle string `json:"issue_title"`
18+
// username of the user or organization owning the repository
19+
RepoOwnerName string `json:"repo_owner_name"`
20+
RepoName string `json:"repo_name"`
2021
}
2122

2223
// StopWatches represent a list of stopwatches

modules/structs/package.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import (
99

1010
// Package represents a package
1111
type Package struct {
12-
ID int64 `json:"id"`
12+
ID int64 `json:"id"`
13+
// username of the user or organization owning the package
1314
Owner *User `json:"owner"`
1415
Repository *Repository `json:"repository"`
1516
Creator *User `json:"creator"`

modules/structs/repo.go

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,17 @@ type ExternalWiki struct {
4848

4949
// Repository represents a repository
5050
type Repository struct {
51-
ID int64 `json:"id"`
52-
Owner *User `json:"owner"`
53-
Name string `json:"name"`
54-
FullName string `json:"full_name"`
55-
Description string `json:"description"`
56-
Empty bool `json:"empty"`
57-
Private bool `json:"private"`
58-
Fork bool `json:"fork"`
59-
Template bool `json:"template"`
51+
ID int64 `json:"id"`
52+
// username of the user or organization owning the repository
53+
Owner *User `json:"owner"`
54+
Name string `json:"name"`
55+
FullName string `json:"full_name"`
56+
Description string `json:"description"`
57+
Empty bool `json:"empty"`
58+
Private bool `json:"private"`
59+
Fork bool `json:"fork"`
60+
Template bool `json:"template"`
61+
// the original repository if the repository in the parameter is a fork; else empty
6062
Parent *Repository `json:"parent"`
6163
Mirror bool `json:"mirror"`
6264
Size int `json:"size"`
@@ -228,11 +230,11 @@ type EditRepoOption struct {
228230
// GenerateRepoOption options when creating repository using a template
229231
// swagger:model
230232
type GenerateRepoOption struct {
231-
// The organization or person who will own the new repository
233+
// username of the user or organization who will own the repository
232234
//
233235
// required: true
234236
Owner string `json:"owner"`
235-
// Name of the repository to create
237+
// name of the repository to create
236238
//
237239
// required: true
238240
// unique: true
@@ -293,6 +295,7 @@ type UpdateBranchRepoOption struct {
293295
// TransferRepoOption options when transfer a repository's ownership
294296
// swagger:model
295297
type TransferRepoOption struct {
298+
// username of the user or organization who will own the repository
296299
// required: true
297300
NewOwner string `json:"new_owner"`
298301
// ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories.
@@ -354,8 +357,9 @@ type MigrateRepoOptions struct {
354357
CloneAddr string `json:"clone_addr" binding:"Required"`
355358
// deprecated (only for backwards compatibility)
356359
RepoOwnerID int64 `json:"uid"`
357-
// Name of User or Organisation who will own Repo after migration
360+
// username of the user or organization who will own the repository after migration
358361
RepoOwner string `json:"repo_owner"`
362+
// name of the repo
359363
// required: true
360364
RepoName string `json:"repo_name" binding:"Required;AlphaDashDot;MaxSize(100)"`
361365

modules/structs/user_key.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ type PublicKey struct {
1515
Title string `json:"title,omitempty"`
1616
Fingerprint string `json:"fingerprint,omitempty"`
1717
// swagger:strfmt date-time
18-
Created time.Time `json:"created_at"`
19-
Updated time.Time `json:"last_used_at"`
20-
Owner *User `json:"user,omitempty"`
21-
ReadOnly bool `json:"read_only,omitempty"`
22-
KeyType string `json:"key_type,omitempty"`
18+
Created time.Time `json:"created_at"`
19+
Updated time.Time `json:"last_used_at"`
20+
// username of the user or organization owning the key
21+
Owner *User `json:"user,omitempty"`
22+
ReadOnly bool `json:"read_only,omitempty"`
23+
KeyType string `json:"key_type,omitempty"`
2324
}

0 commit comments

Comments
 (0)