Skip to content

Add owner and parent fields clarification to docs #35023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions modules/structs/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ type PullRequestMeta struct {

// RepositoryMeta basic repository information
type RepositoryMeta struct {
ID int64 `json:"id"`
Name string `json:"name"`
ID int64 `json:"id"`
Name string `json:"name"`
// username of the user or organization owning the repository
Owner string `json:"owner"`
FullName string `json:"full_name"`
}
Expand Down Expand Up @@ -262,7 +263,8 @@ func (it IssueTemplate) Type() IssueTemplateType {
// IssueMeta basic issue information
// swagger:model
type IssueMeta struct {
Index int64 `json:"index"`
Index int64 `json:"index"`
// username of the user or organization owning the issue
Owner string `json:"owner"`
Name string `json:"repo"`
}
Expand Down
15 changes: 8 additions & 7 deletions modules/structs/issue_stopwatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ import (
// StopWatch represent a running stopwatch
type StopWatch struct {
// swagger:strfmt date-time
Created time.Time `json:"created"`
Seconds int64 `json:"seconds"`
Duration string `json:"duration"`
IssueIndex int64 `json:"issue_index"`
IssueTitle string `json:"issue_title"`
RepoOwnerName string `json:"repo_owner_name"`
RepoName string `json:"repo_name"`
Created time.Time `json:"created"`
Seconds int64 `json:"seconds"`
Duration string `json:"duration"`
IssueIndex int64 `json:"issue_index"`
IssueTitle string `json:"issue_title"`
// username of the user or organization owning the repository
RepoOwnerName string `json:"repo_owner_name"`
RepoName string `json:"repo_name"`
}

// StopWatches represent a list of stopwatches
Expand Down
3 changes: 2 additions & 1 deletion modules/structs/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import (

// Package represents a package
type Package struct {
ID int64 `json:"id"`
ID int64 `json:"id"`
// user or organization owning the package
Owner *User `json:"owner"`
Repository *Repository `json:"repository"`
Creator *User `json:"creator"`
Expand Down
27 changes: 14 additions & 13 deletions modules/structs/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,17 @@ type ExternalWiki struct {

// Repository represents a repository
type Repository struct {
ID int64 `json:"id"`
Owner *User `json:"owner"`
Name string `json:"name"`
FullName string `json:"full_name"`
Description string `json:"description"`
Empty bool `json:"empty"`
Private bool `json:"private"`
Fork bool `json:"fork"`
Template bool `json:"template"`
ID int64 `json:"id"`
// user or organization owning the repository
Owner *User `json:"owner"`
Name string `json:"name"`
FullName string `json:"full_name"`
Description string `json:"description"`
Empty bool `json:"empty"`
Private bool `json:"private"`
Fork bool `json:"fork"`
Template bool `json:"template"`
// the original repository if the repository in the parameter is a fork; else empty
Parent *Repository `json:"parent,omitempty"`
Mirror bool `json:"mirror"`
Size int `json:"size"`
Expand Down Expand Up @@ -228,12 +230,10 @@ type EditRepoOption struct {
// GenerateRepoOption options when creating repository using a template
// swagger:model
type GenerateRepoOption struct {
// The organization or person who will own the new repository
// username of the user or organization who will own the repository
//
// required: true
Owner string `json:"owner"`
// Name of the repository to create
//
// required: true
// unique: true
Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(100)"`
Expand Down Expand Up @@ -293,6 +293,7 @@ type UpdateBranchRepoOption struct {
// TransferRepoOption options when transfer a repository's ownership
// swagger:model
type TransferRepoOption struct {
// username of the user or organization who will own the repository
// required: true
NewOwner string `json:"new_owner"`
// ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories.
Expand Down Expand Up @@ -354,7 +355,7 @@ type MigrateRepoOptions struct {
CloneAddr string `json:"clone_addr" binding:"Required"`
// deprecated (only for backwards compatibility)
RepoOwnerID int64 `json:"uid"`
// Name of User or Organisation who will own Repo after migration
// username of the user or organization who will own the repository after migration
RepoOwner string `json:"repo_owner"`
// required: true
RepoName string `json:"repo_name" binding:"Required;AlphaDashDot;MaxSize(100)"`
Expand Down
11 changes: 6 additions & 5 deletions modules/structs/user_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ type PublicKey struct {
Title string `json:"title,omitempty"`
Fingerprint string `json:"fingerprint,omitempty"`
// swagger:strfmt date-time
Created time.Time `json:"created_at"`
Updated time.Time `json:"last_used_at"`
Owner *User `json:"user,omitempty"`
ReadOnly bool `json:"read_only,omitempty"`
KeyType string `json:"key_type,omitempty"`
Created time.Time `json:"created_at"`
Updated time.Time `json:"last_used_at"`
// user or organization owning the key
Owner *User `json:"user,omitempty"`
ReadOnly bool `json:"read_only,omitempty"`
KeyType string `json:"key_type,omitempty"`
}
4 changes: 2 additions & 2 deletions routers/api/v1/admin/adopt.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func AdoptRepository(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: owner of the repo
// description: username of the user or organization owning the repository
// type: string
// required: true
// - name: repo
Expand Down Expand Up @@ -129,7 +129,7 @@ func DeleteUnadoptedRepository(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: owner of the repo
// description: username of the user or organization owning the repository
// type: string
// required: true
// - name: repo
Expand Down
4 changes: 2 additions & 2 deletions routers/api/v1/misc/signing.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func SigningKeyGPG(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: owner of the repo
// description: username of the user or organization owning the repository
// type: string
// required: true
// - name: repo
Expand Down Expand Up @@ -89,7 +89,7 @@ func SigningKeySSH(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: owner of the repo
// description: username of the user or organization owning the repository
// type: string
// required: true
// - name: repo
Expand Down
4 changes: 2 additions & 2 deletions routers/api/v1/notify/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func ListRepoNotifications(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: owner of the repo
// description: username of the user or organization owning the repository
// type: string
// required: true
// - name: repo
Expand Down Expand Up @@ -142,7 +142,7 @@ func ReadRepoNotifications(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: owner of the repo
// description: username of the user or organization owning the repository
// type: string
// required: true
// - name: repo
Expand Down
16 changes: 8 additions & 8 deletions routers/api/v1/packages/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func ListPackages(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: owner of the packages
// description: username of the user or organization owning the packages
// type: string
// required: true
// - name: page
Expand Down Expand Up @@ -83,7 +83,7 @@ func GetPackage(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: owner of the package
// description: username of the user or organization owning the package
// type: string
// required: true
// - name: type
Expand Down Expand Up @@ -124,7 +124,7 @@ func DeletePackage(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: owner of the package
// description: username of the user or organization owning the package
// type: string
// required: true
// - name: type
Expand Down Expand Up @@ -166,7 +166,7 @@ func ListPackageFiles(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: owner of the package
// description: username of the user or organization owning the package
// type: string
// required: true
// - name: type
Expand Down Expand Up @@ -208,7 +208,7 @@ func ListPackageVersions(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: owner of the package
// description: username of the user or organization owning the package
// type: string
// required: true
// - name: type
Expand Down Expand Up @@ -264,7 +264,7 @@ func GetLatestPackageVersion(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: owner of the package
// description: username of the user or organization owning the package
// type: string
// required: true
// - name: type
Expand Down Expand Up @@ -321,7 +321,7 @@ func LinkPackage(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: owner of the package
// description: username of the user or organization owning the package
// type: string
// required: true
// - name: type
Expand Down Expand Up @@ -388,7 +388,7 @@ func UnlinkPackage(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: owner of the package
// description: username of the user or organization owning the package
// type: string
// required: true
// - name: type
Expand Down
Loading