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

Merged
merged 4 commits into from
Jul 23, 2025
Merged
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
3 changes: 2 additions & 1 deletion modules/structs/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ func (it IssueTemplate) Type() IssueTemplateType {
// IssueMeta basic issue information
// swagger:model
type IssueMeta struct {
Index int64 `json:"index"`
Index int64 `json:"index"`
// owner of the issue's repo
Owner string `json:"owner"`
Name string `json:"repo"`
}
Expand Down
29 changes: 14 additions & 15 deletions modules/structs/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,16 @@ 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"`
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 this repository is a fork, otherwise null
Parent *Repository `json:"parent,omitempty"`
Mirror bool `json:"mirror"`
Size int `json:"size"`
Expand Down Expand Up @@ -225,15 +226,13 @@ type EditRepoOption struct {
EnablePrune *bool `json:"enable_prune,omitempty"`
}

// GenerateRepoOption options when creating repository using a template
// GenerateRepoOption options when creating a repository using a template
// swagger:model
type GenerateRepoOption struct {
// The organization or person who will own the new repository
// the organization's name or individual user's name who will own the new 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 @@ -352,9 +351,9 @@ func (gt GitServiceType) Title() string {
type MigrateRepoOptions struct {
// required: true
CloneAddr string `json:"clone_addr" binding:"Required"`
// deprecated (only for backwards compatibility)
// deprecated (only for backwards compatibility, use repo_owner instead)
RepoOwnerID int64 `json:"uid"`
// Name of User or Organisation who will own Repo after migration
// the organization's name or individual user's name who will own the migrated repository
RepoOwner string `json:"repo_owner"`
// required: true
RepoName string `json:"repo_name" binding:"Required;AlphaDashDot;MaxSize(100)"`
Expand Down
34 changes: 17 additions & 17 deletions routers/api/v1/repo/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (Action) ListActionsSecrets(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: owner of the repository
// description: owner of the repo
// type: string
// required: true
// - name: repo
Expand Down Expand Up @@ -216,7 +216,7 @@ func (Action) GetVariable(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: name of the owner
// description: owner of the repo
// type: string
// required: true
// - name: repo
Expand Down Expand Up @@ -270,7 +270,7 @@ func (Action) DeleteVariable(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: name of the owner
// description: owner of the repo
// type: string
// required: true
// - name: repo
Expand Down Expand Up @@ -319,7 +319,7 @@ func (Action) CreateVariable(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: name of the owner
// description: owner of the repo
// type: string
// required: true
// - name: repo
Expand Down Expand Up @@ -386,7 +386,7 @@ func (Action) UpdateVariable(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: name of the owner
// description: owner of the repo
// type: string
// required: true
// - name: repo
Expand Down Expand Up @@ -458,7 +458,7 @@ func (Action) ListVariables(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: name of the owner
// description: owner of the repo
// type: string
// required: true
// - name: repo
Expand Down Expand Up @@ -660,7 +660,7 @@ func (Action) ListWorkflowJobs(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: name of the owner
// description: owner of the repo
// type: string
// required: true
// - name: repo
Expand Down Expand Up @@ -704,7 +704,7 @@ func (Action) ListWorkflowRuns(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: name of the owner
// description: owner of the repo
// type: string
// required: true
// - name: repo
Expand Down Expand Up @@ -1110,7 +1110,7 @@ func GetWorkflowRun(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: name of the owner
// description: owner of the repo
// type: string
// required: true
// - name: repo
Expand Down Expand Up @@ -1156,7 +1156,7 @@ func ListWorkflowRunJobs(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: name of the owner
// description: owner of the repo
// type: string
// required: true
// - name: repo
Expand Down Expand Up @@ -1215,7 +1215,7 @@ func GetWorkflowJob(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: name of the owner
// description: owner of the repo
// type: string
// required: true
// - name: repo
Expand Down Expand Up @@ -1261,7 +1261,7 @@ func GetArtifactsOfRun(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: name of the owner
// description: owner of the repo
// type: string
// required: true
// - name: repo
Expand Down Expand Up @@ -1330,7 +1330,7 @@ func DeleteActionRun(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: name of the owner
// description: owner of the repo
// type: string
// required: true
// - name: repo
Expand Down Expand Up @@ -1382,7 +1382,7 @@ func GetArtifacts(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: name of the owner
// description: owner of the repo
// type: string
// required: true
// - name: repo
Expand Down Expand Up @@ -1443,7 +1443,7 @@ func GetArtifact(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: name of the owner
// description: owner of the repo
// type: string
// required: true
// - name: repo
Expand Down Expand Up @@ -1492,7 +1492,7 @@ func DeleteArtifact(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: name of the owner
// description: owner of the repo
// type: string
// required: true
// - name: repo
Expand Down Expand Up @@ -1559,7 +1559,7 @@ func DownloadArtifact(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: name of the owner
// description: owner of the repo
// type: string
// required: true
// - name: repo
Expand Down
2 changes: 1 addition & 1 deletion routers/api/v1/repo/actions_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func DownloadActionsRunJobLogs(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: name of the owner
// description: owner of the repo
// type: string
// required: true
// - name: repo
Expand Down
2 changes: 1 addition & 1 deletion routers/api/v1/repo/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func ListPullRequests(ctx *context.APIContext) {
// parameters:
// - name: owner
// in: path
// description: Owner of the repo
// description: owner of the repo
// type: string
// required: true
// - name: repo
Expand Down
2 changes: 1 addition & 1 deletion routers/api/v1/repo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ func Generate(ctx *context.APIContext) {
// parameters:
// - name: template_owner
// in: path
// description: name of the template repository owner
// description: owner of the template repository
// type: string
// required: true
// - name: template_repo
Expand Down
1 change: 1 addition & 0 deletions templates/swagger/ui.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<link href="{{AssetUrlPrefix}}/css/swagger.css?v={{AssetVersion}}" rel="stylesheet">
</head>
<body>
{{/* TODO: add Help & Glossary to help users understand the API, and explain some concepts like "Owner" */}}
<a class="swagger-back-link" href="{{AppSubUrl}}/">{{svg "octicon-reply"}}{{ctx.Locale.Tr "return_to_gitea"}}</a>
<div id="swagger-ui" data-source="{{AppSubUrl}}/swagger.{{.APIJSONVersion}}.json"></div>
<footer class="page-footer"></footer>
Expand Down
Loading