1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-25 19:58:36 +00:00

Add owner and parent fields clarification to docs (#35023)

Issue: https://github.com/go-gitea/gitea/issues/9637

Changes introduced: I have clarified the problematic terms (owner and
parent) in all affected endpoints.

The changes were made to relevant:

- HTTP endpoint parameters' descriptions
- response/request models' fields

This MR is big, but most changes are the same. If you'd like me to break
this MR into several smaller ones, let me know :)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
AlexMaryW
2025-07-23 08:44:34 +02:00
committed by GitHub
parent 43831ff0ca
commit c10c4203ee
8 changed files with 62 additions and 61 deletions

View File

@@ -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"`
}

View File

@@ -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"`
@@ -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)"`
@@ -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)"`