From 90e3f9f0e675d2d73376c8844957a6b9103acbd9 Mon Sep 17 00:00:00 2001 From: Aleks Date: Sun, 20 Jul 2025 12:43:28 +0200 Subject: [PATCH 1/3] Standardize `owner` and `parent` parameters and fields descriptions --- modules/structs/issue.go | 8 +++-- modules/structs/issue_stopwatch.go | 15 ++++----- modules/structs/package.go | 3 +- modules/structs/repo.go | 27 ++++++++-------- modules/structs/user_key.go | 11 ++++--- routers/api/v1/repo/action.go | 34 ++++++++++----------- routers/api/v1/repo/actions_run.go | 2 +- routers/api/v1/repo/pull.go | 2 +- routers/api/v1/repo/repo.go | 2 +- templates/swagger/v1_json.tmpl | 49 ++++++++++++++++-------------- 10 files changed, 81 insertions(+), 72 deletions(-) diff --git a/modules/structs/issue.go b/modules/structs/issue.go index df0be8f9ec7b6..ff9cbeaba028e 100644 --- a/modules/structs/issue.go +++ b/modules/structs/issue.go @@ -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"` + // owner of the repo Owner string `json:"owner"` FullName string `json:"full_name"` } @@ -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"` + // owner of the issue Owner string `json:"owner"` Name string `json:"repo"` } diff --git a/modules/structs/issue_stopwatch.go b/modules/structs/issue_stopwatch.go index ceade1ddd2f77..8794b7223feda 100644 --- a/modules/structs/issue_stopwatch.go +++ b/modules/structs/issue_stopwatch.go @@ -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"` + // owner of the repo + RepoOwnerName string `json:"repo_owner_name"` + RepoName string `json:"repo_name"` } // StopWatches represent a list of stopwatches diff --git a/modules/structs/package.go b/modules/structs/package.go index 1973f925a584e..562613f597ec8 100644 --- a/modules/structs/package.go +++ b/modules/structs/package.go @@ -9,7 +9,8 @@ import ( // Package represents a package type Package struct { - ID int64 `json:"id"` + ID int64 `json:"id"` + // owner of the package Owner *User `json:"owner"` Repository *Repository `json:"repository"` Creator *User `json:"creator"` diff --git a/modules/structs/repo.go b/modules/structs/repo.go index aca5d9c3f431b..c77e013eb4a34 100644 --- a/modules/structs/repo.go +++ b/modules/structs/repo.go @@ -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"` + // owner of the repo + 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"` @@ -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 + // owner of the repo // // 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)"` @@ -293,6 +293,7 @@ type UpdateBranchRepoOption struct { // TransferRepoOption options when transfer a repository's ownership // swagger:model type TransferRepoOption struct { + // new owner of the repo // 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. @@ -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 + // owner of the repo after migration RepoOwner string `json:"repo_owner"` // required: true RepoName string `json:"repo_name" binding:"Required;AlphaDashDot;MaxSize(100)"` diff --git a/modules/structs/user_key.go b/modules/structs/user_key.go index 16225a852a57c..61551d47287c3 100644 --- a/modules/structs/user_key.go +++ b/modules/structs/user_key.go @@ -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"` + // owner of the key + Owner *User `json:"user,omitempty"` + ReadOnly bool `json:"read_only,omitempty"` + KeyType string `json:"key_type,omitempty"` } diff --git a/routers/api/v1/repo/action.go b/routers/api/v1/repo/action.go index ef0c5cc199596..99eef2f53b7df 100644 --- a/routers/api/v1/repo/action.go +++ b/routers/api/v1/repo/action.go @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/routers/api/v1/repo/actions_run.go b/routers/api/v1/repo/actions_run.go index c6d18af6aa70a..a12a6fdd6d796 100644 --- a/routers/api/v1/repo/actions_run.go +++ b/routers/api/v1/repo/actions_run.go @@ -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 diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go index e05b9b165c2fc..09729200d5248 100644 --- a/routers/api/v1/repo/pull.go +++ b/routers/api/v1/repo/pull.go @@ -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 diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index 292b267c0114b..4b88ed0b78199 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -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 diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 323e0d64ac567..db9ee99a6900b 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -4585,7 +4585,7 @@ "parameters": [ { "type": "string", - "description": "name of the owner", + "description": "owner of the repo", "name": "owner", "in": "path", "required": true @@ -4630,7 +4630,7 @@ "parameters": [ { "type": "string", - "description": "name of the owner", + "description": "owner of the repo", "name": "owner", "in": "path", "required": true @@ -4674,7 +4674,7 @@ "parameters": [ { "type": "string", - "description": "name of the owner", + "description": "owner of the repo", "name": "owner", "in": "path", "required": true @@ -4720,7 +4720,7 @@ "parameters": [ { "type": "string", - "description": "name of the owner", + "description": "owner of the repo", "name": "owner", "in": "path", "required": true @@ -4766,7 +4766,7 @@ "parameters": [ { "type": "string", - "description": "name of the owner", + "description": "owner of the repo", "name": "owner", "in": "path", "required": true @@ -4823,7 +4823,7 @@ "parameters": [ { "type": "string", - "description": "name of the owner", + "description": "owner of the repo", "name": "owner", "in": "path", "required": true @@ -4869,7 +4869,7 @@ "parameters": [ { "type": "string", - "description": "name of the owner", + "description": "owner of the repo", "name": "owner", "in": "path", "required": true @@ -5108,7 +5108,7 @@ "parameters": [ { "type": "string", - "description": "name of the owner", + "description": "owner of the repo", "name": "owner", "in": "path", "required": true @@ -5189,7 +5189,7 @@ "parameters": [ { "type": "string", - "description": "name of the owner", + "description": "owner of the repo", "name": "owner", "in": "path", "required": true @@ -5233,7 +5233,7 @@ "parameters": [ { "type": "string", - "description": "name of the owner", + "description": "owner of the repo", "name": "owner", "in": "path", "required": true @@ -5279,7 +5279,7 @@ "parameters": [ { "type": "string", - "description": "name of the owner", + "description": "owner of the repo", "name": "owner", "in": "path", "required": true @@ -5331,7 +5331,7 @@ "parameters": [ { "type": "string", - "description": "name of the owner", + "description": "owner of the repo", "name": "owner", "in": "path", "required": true @@ -5395,7 +5395,7 @@ "parameters": [ { "type": "string", - "description": "owner of the repository", + "description": "owner of the repo", "name": "owner", "in": "path", "required": true @@ -5609,7 +5609,7 @@ "parameters": [ { "type": "string", - "description": "name of the owner", + "description": "owner of the repo", "name": "owner", "in": "path", "required": true @@ -5660,7 +5660,7 @@ "parameters": [ { "type": "string", - "description": "name of the owner", + "description": "owner of the repo", "name": "owner", "in": "path", "required": true @@ -5704,7 +5704,7 @@ "parameters": [ { "type": "string", - "description": "name of the owner", + "description": "owner of the repo", "name": "owner", "in": "path", "required": true @@ -5758,7 +5758,7 @@ "parameters": [ { "type": "string", - "description": "name of the owner", + "description": "owner of the repo", "name": "owner", "in": "path", "required": true @@ -5812,7 +5812,7 @@ "parameters": [ { "type": "string", - "description": "name of the owner", + "description": "owner of the repo", "name": "owner", "in": "path", "required": true @@ -13424,7 +13424,7 @@ "parameters": [ { "type": "string", - "description": "Owner of the repo", + "description": "owner of the repo", "name": "owner", "in": "path", "required": true @@ -17463,7 +17463,7 @@ "parameters": [ { "type": "string", - "description": "name of the template repository owner", + "description": "owner of the template repository", "name": "template_owner", "in": "path", "required": true @@ -25006,13 +25006,12 @@ "x-go-name": "Labels" }, "name": { - "description": "Name of the repository to create", "type": "string", "uniqueItems": true, "x-go-name": "Name" }, "owner": { - "description": "The organization or person who will own the new repository", + "description": "owner of the repo", "type": "string", "x-go-name": "Owner" }, @@ -25545,6 +25544,7 @@ "x-go-name": "Index" }, "owner": { + "description": "owner of the issue", "type": "string", "x-go-name": "Owner" }, @@ -25929,7 +25929,7 @@ "x-go-name": "RepoName" }, "repo_owner": { - "description": "Name of User or Organisation who will own Repo after migration", + "description": "owner of the repo after migration", "type": "string", "x-go-name": "RepoOwner" }, @@ -27567,6 +27567,7 @@ "x-go-name": "Name" }, "owner": { + "description": "owner of the repo", "type": "string", "x-go-name": "Owner" } @@ -27661,6 +27662,7 @@ "x-go-name": "RepoName" }, "repo_owner_name": { + "description": "owner of the repo", "type": "string", "x-go-name": "RepoOwnerName" }, @@ -28054,6 +28056,7 @@ ], "properties": { "new_owner": { + "description": "new owner of the repo", "type": "string", "x-go-name": "NewOwner" }, From 98e9ce68ee840015efe22aefca23126caf18d06a Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 21 Jul 2025 14:54:23 +0800 Subject: [PATCH 2/3] improve --- modules/structs/issue.go | 7 +++---- modules/structs/issue_stopwatch.go | 15 +++++++-------- modules/structs/package.go | 3 +-- modules/structs/repo.go | 13 +++++-------- modules/structs/user_key.go | 11 +++++------ templates/swagger/ui.tmpl | 1 + templates/swagger/v1_json.tmpl | 8 ++------ 7 files changed, 24 insertions(+), 34 deletions(-) diff --git a/modules/structs/issue.go b/modules/structs/issue.go index ff9cbeaba028e..322ac1e4caa4e 100644 --- a/modules/structs/issue.go +++ b/modules/structs/issue.go @@ -35,9 +35,8 @@ type PullRequestMeta struct { // RepositoryMeta basic repository information type RepositoryMeta struct { - ID int64 `json:"id"` - Name string `json:"name"` - // owner of the repo + ID int64 `json:"id"` + Name string `json:"name"` Owner string `json:"owner"` FullName string `json:"full_name"` } @@ -264,7 +263,7 @@ func (it IssueTemplate) Type() IssueTemplateType { // swagger:model type IssueMeta struct { Index int64 `json:"index"` - // owner of the issue + // owner of the issue's repo Owner string `json:"owner"` Name string `json:"repo"` } diff --git a/modules/structs/issue_stopwatch.go b/modules/structs/issue_stopwatch.go index 8794b7223feda..ceade1ddd2f77 100644 --- a/modules/structs/issue_stopwatch.go +++ b/modules/structs/issue_stopwatch.go @@ -10,14 +10,13 @@ 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"` - // owner of the repo - 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"` + RepoOwnerName string `json:"repo_owner_name"` + RepoName string `json:"repo_name"` } // StopWatches represent a list of stopwatches diff --git a/modules/structs/package.go b/modules/structs/package.go index 562613f597ec8..1973f925a584e 100644 --- a/modules/structs/package.go +++ b/modules/structs/package.go @@ -9,8 +9,7 @@ import ( // Package represents a package type Package struct { - ID int64 `json:"id"` - // owner of the package + ID int64 `json:"id"` Owner *User `json:"owner"` Repository *Repository `json:"repository"` Creator *User `json:"creator"` diff --git a/modules/structs/repo.go b/modules/structs/repo.go index c77e013eb4a34..854890217b5fa 100644 --- a/modules/structs/repo.go +++ b/modules/structs/repo.go @@ -48,8 +48,7 @@ type ExternalWiki struct { // Repository represents a repository type Repository struct { - ID int64 `json:"id"` - // owner of the repo + ID int64 `json:"id"` Owner *User `json:"owner"` Name string `json:"name"` FullName string `json:"full_name"` @@ -58,7 +57,7 @@ type Repository struct { 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 + // the original repository if this repository is a fork, otherwise null Parent *Repository `json:"parent,omitempty"` Mirror bool `json:"mirror"` Size int `json:"size"` @@ -230,7 +229,7 @@ type EditRepoOption struct { // GenerateRepoOption options when creating repository using a template // swagger:model type GenerateRepoOption struct { - // owner of the repo + // The organization's name or individual user's name who will own the new repository // // required: true Owner string `json:"owner"` @@ -293,7 +292,6 @@ type UpdateBranchRepoOption struct { // TransferRepoOption options when transfer a repository's ownership // swagger:model type TransferRepoOption struct { - // new owner of the repo // 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. @@ -354,9 +352,8 @@ type MigrateRepoOptions struct { // required: true CloneAddr string `json:"clone_addr" binding:"Required"` // deprecated (only for backwards compatibility) - RepoOwnerID int64 `json:"uid"` - // owner of the repo after migration - RepoOwner string `json:"repo_owner"` + RepoOwnerID int64 `json:"uid"` + RepoOwner string `json:"repo_owner"` // required: true RepoName string `json:"repo_name" binding:"Required;AlphaDashDot;MaxSize(100)"` diff --git a/modules/structs/user_key.go b/modules/structs/user_key.go index 61551d47287c3..16225a852a57c 100644 --- a/modules/structs/user_key.go +++ b/modules/structs/user_key.go @@ -15,10 +15,9 @@ 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 of the key - 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"` + Owner *User `json:"user,omitempty"` + ReadOnly bool `json:"read_only,omitempty"` + KeyType string `json:"key_type,omitempty"` } diff --git a/templates/swagger/ui.tmpl b/templates/swagger/ui.tmpl index c48ba82fe0c1e..4ff3472807143 100644 --- a/templates/swagger/ui.tmpl +++ b/templates/swagger/ui.tmpl @@ -5,6 +5,7 @@ + {{/* TODO: add Help & Glossary to help users understand the API, and explain some concepts like "Owner" */}} {{svg "octicon-reply"}}{{ctx.Locale.Tr "return_to_gitea"}}
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index db9ee99a6900b..ad8559e242081 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -25011,7 +25011,7 @@ "x-go-name": "Name" }, "owner": { - "description": "owner of the repo", + "description": "The organization's name or individual user's name who will own the new repository", "type": "string", "x-go-name": "Owner" }, @@ -25544,7 +25544,7 @@ "x-go-name": "Index" }, "owner": { - "description": "owner of the issue", + "description": "owner of the issue's repo", "type": "string", "x-go-name": "Owner" }, @@ -25929,7 +25929,6 @@ "x-go-name": "RepoName" }, "repo_owner": { - "description": "owner of the repo after migration", "type": "string", "x-go-name": "RepoOwner" }, @@ -27567,7 +27566,6 @@ "x-go-name": "Name" }, "owner": { - "description": "owner of the repo", "type": "string", "x-go-name": "Owner" } @@ -27662,7 +27660,6 @@ "x-go-name": "RepoName" }, "repo_owner_name": { - "description": "owner of the repo", "type": "string", "x-go-name": "RepoOwnerName" }, @@ -28056,7 +28053,6 @@ ], "properties": { "new_owner": { - "description": "new owner of the repo", "type": "string", "x-go-name": "NewOwner" }, From 8682d25228cb4be81b8835805d0acb07633a65ef Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 21 Jul 2025 15:05:40 +0800 Subject: [PATCH 3/3] fine tune --- modules/structs/repo.go | 11 ++++++----- templates/swagger/v1_json.tmpl | 7 ++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/structs/repo.go b/modules/structs/repo.go index 854890217b5fa..f2e11b154268c 100644 --- a/modules/structs/repo.go +++ b/modules/structs/repo.go @@ -226,10 +226,10 @@ 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's name or individual user's name 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"` @@ -351,9 +351,10 @@ func (gt GitServiceType) Title() string { type MigrateRepoOptions struct { // required: true CloneAddr string `json:"clone_addr" binding:"Required"` - // deprecated (only for backwards compatibility) - RepoOwnerID int64 `json:"uid"` - RepoOwner string `json:"repo_owner"` + // deprecated (only for backwards compatibility, use repo_owner instead) + RepoOwnerID int64 `json:"uid"` + // 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)"` diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index ad8559e242081..35c743dcd4a24 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -24968,7 +24968,7 @@ "x-go-package": "code.gitea.io/gitea/modules/structs" }, "GenerateRepoOption": { - "description": "GenerateRepoOption options when creating repository using a template", + "description": "GenerateRepoOption options when creating a repository using a template", "type": "object", "required": [ "owner", @@ -25011,7 +25011,7 @@ "x-go-name": "Name" }, "owner": { - "description": "The organization's name or individual user's name who will own the new repository", + "description": "the organization's name or individual user's name who will own the new repository", "type": "string", "x-go-name": "Owner" }, @@ -25929,6 +25929,7 @@ "x-go-name": "RepoName" }, "repo_owner": { + "description": "the organization's name or individual user's name who will own the migrated repository", "type": "string", "x-go-name": "RepoOwner" }, @@ -25948,7 +25949,7 @@ "x-go-name": "Service" }, "uid": { - "description": "deprecated (only for backwards compatibility)", + "description": "deprecated (only for backwards compatibility, use repo_owner instead)", "type": "integer", "format": "int64", "x-go-name": "RepoOwnerID"