Merge pull request '[CHORE] Fix swagger deprecation message' (#4916) from gusted/swagger-deprecated into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4916 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
commit
6102f48c7d
11 changed files with 17 additions and 17 deletions
|
@ -10,7 +10,7 @@ type Activity struct {
|
||||||
UserID int64 `json:"user_id"` // Receiver user
|
UserID int64 `json:"user_id"` // Receiver user
|
||||||
// the type of action
|
// the type of action
|
||||||
//
|
//
|
||||||
// enum: create_repo,rename_repo,star_repo,watch_repo,commit_repo,create_issue,create_pull_request,transfer_repo,push_tag,comment_issue,merge_pull_request,close_issue,reopen_issue,close_pull_request,reopen_pull_request,delete_tag,delete_branch,mirror_sync_push,mirror_sync_create,mirror_sync_delete,approve_pull_request,reject_pull_request,comment_pull,publish_release,pull_review_dismissed,pull_request_ready_for_review,auto_merge_pull_request
|
// enum: ["create_repo", "rename_repo", "star_repo", "watch_repo", "commit_repo", "create_issue", "create_pull_request", "transfer_repo", "push_tag", "comment_issue", "merge_pull_request", "close_issue", "reopen_issue", "close_pull_request", "reopen_pull_request", "delete_tag", "delete_branch", "mirror_sync_push", "mirror_sync_create", "mirror_sync_delete", "approve_pull_request", "reject_pull_request", "comment_pull", "publish_release", "pull_review_dismissed", "pull_request_ready_for_review", "auto_merge_pull_request"]
|
||||||
OpType string `json:"op_type"`
|
OpType string `json:"op_type"`
|
||||||
ActUserID int64 `json:"act_user_id"`
|
ActUserID int64 `json:"act_user_id"`
|
||||||
ActUser *User `json:"act_user"`
|
ActUser *User `json:"act_user"`
|
||||||
|
|
|
@ -18,7 +18,7 @@ type Attachment struct {
|
||||||
Created time.Time `json:"created_at"`
|
Created time.Time `json:"created_at"`
|
||||||
UUID string `json:"uuid"`
|
UUID string `json:"uuid"`
|
||||||
DownloadURL string `json:"browser_download_url"`
|
DownloadURL string `json:"browser_download_url"`
|
||||||
// Enum: attachment,external
|
// enum: ["attachment", "external"]
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ type CreateHookOptionConfig map[string]string
|
||||||
// CreateHookOption options when create a hook
|
// CreateHookOption options when create a hook
|
||||||
type CreateHookOption struct {
|
type CreateHookOption struct {
|
||||||
// required: true
|
// required: true
|
||||||
// enum: forgejo,dingtalk,discord,gitea,gogs,msteams,slack,telegram,feishu,wechatwork,packagist
|
// enum: ["forgejo", "dingtalk", "discord", "gitea", "gogs", "msteams", "slack", "telegram", "feishu", "wechatwork", "packagist"]
|
||||||
Type string `json:"type" binding:"Required"`
|
Type string `json:"type" binding:"Required"`
|
||||||
// required: true
|
// required: true
|
||||||
Config CreateHookOptionConfig `json:"config" binding:"Required"`
|
Config CreateHookOptionConfig `json:"config" binding:"Required"`
|
||||||
|
|
|
@ -63,7 +63,7 @@ type Issue struct {
|
||||||
// Whether the issue is open or closed
|
// Whether the issue is open or closed
|
||||||
//
|
//
|
||||||
// type: string
|
// type: string
|
||||||
// enum: open,closed
|
// enum: ["open", "closed"]
|
||||||
State StateType `json:"state"`
|
State StateType `json:"state"`
|
||||||
IsLocked bool `json:"is_locked"`
|
IsLocked bool `json:"is_locked"`
|
||||||
Comments int `json:"comments"`
|
Comments int `json:"comments"`
|
||||||
|
|
|
@ -31,7 +31,7 @@ type CreateMilestoneOption struct {
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
// swagger:strfmt date-time
|
// swagger:strfmt date-time
|
||||||
Deadline *time.Time `json:"due_on"`
|
Deadline *time.Time `json:"due_on"`
|
||||||
// enum: open,closed
|
// enum: ["open", "closed"]
|
||||||
State string `json:"state"`
|
State string `json:"state"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ type CreateOrgOption struct {
|
||||||
Website string `json:"website" binding:"ValidUrl;MaxSize(255)"`
|
Website string `json:"website" binding:"ValidUrl;MaxSize(255)"`
|
||||||
Location string `json:"location" binding:"MaxSize(50)"`
|
Location string `json:"location" binding:"MaxSize(50)"`
|
||||||
// possible values are `public` (default), `limited` or `private`
|
// possible values are `public` (default), `limited` or `private`
|
||||||
// enum: public,limited,private
|
// enum: ["public", "limited", "private"]
|
||||||
Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
|
Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
|
||||||
RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access"`
|
RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access"`
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ type EditOrgOption struct {
|
||||||
Website string `json:"website" binding:"ValidUrl;MaxSize(255)"`
|
Website string `json:"website" binding:"ValidUrl;MaxSize(255)"`
|
||||||
Location string `json:"location" binding:"MaxSize(50)"`
|
Location string `json:"location" binding:"MaxSize(50)"`
|
||||||
// possible values are `public`, `limited` or `private`
|
// possible values are `public`, `limited` or `private`
|
||||||
// enum: public,limited,private
|
// enum: ["public", "limited", "private"]
|
||||||
Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
|
Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
|
||||||
RepoAdminChangeTeamAccess *bool `json:"repo_admin_change_team_access"`
|
RepoAdminChangeTeamAccess *bool `json:"repo_admin_change_team_access"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ type Team struct {
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
Organization *Organization `json:"organization"`
|
Organization *Organization `json:"organization"`
|
||||||
IncludesAllRepositories bool `json:"includes_all_repositories"`
|
IncludesAllRepositories bool `json:"includes_all_repositories"`
|
||||||
// enum: none,read,write,admin,owner
|
// enum: ["none", "read", "write", "admin", "owner"]
|
||||||
Permission string `json:"permission"`
|
Permission string `json:"permission"`
|
||||||
// example: ["repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.pulls","repo.releases","repo.projects","repo.ext_wiki"]
|
// example: ["repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.pulls","repo.releases","repo.projects","repo.ext_wiki"]
|
||||||
// Deprecated: This variable should be replaced by UnitsMap and will be dropped in later versions.
|
// Deprecated: This variable should be replaced by UnitsMap and will be dropped in later versions.
|
||||||
|
@ -27,7 +27,7 @@ type CreateTeamOption struct {
|
||||||
Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(255)"`
|
Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(255)"`
|
||||||
Description string `json:"description" binding:"MaxSize(255)"`
|
Description string `json:"description" binding:"MaxSize(255)"`
|
||||||
IncludesAllRepositories bool `json:"includes_all_repositories"`
|
IncludesAllRepositories bool `json:"includes_all_repositories"`
|
||||||
// enum: read,write,admin
|
// enum: ["read", "write", "admin"]
|
||||||
Permission string `json:"permission"`
|
Permission string `json:"permission"`
|
||||||
// example: ["repo.actions","repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.ext_wiki","repo.pulls","repo.releases","repo.projects","repo.ext_wiki"]
|
// example: ["repo.actions","repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.ext_wiki","repo.pulls","repo.releases","repo.projects","repo.ext_wiki"]
|
||||||
// Deprecated: This variable should be replaced by UnitsMap and will be dropped in later versions.
|
// Deprecated: This variable should be replaced by UnitsMap and will be dropped in later versions.
|
||||||
|
@ -43,7 +43,7 @@ type EditTeamOption struct {
|
||||||
Name string `json:"name" binding:"AlphaDashDot;MaxSize(255)"`
|
Name string `json:"name" binding:"AlphaDashDot;MaxSize(255)"`
|
||||||
Description *string `json:"description" binding:"MaxSize(255)"`
|
Description *string `json:"description" binding:"MaxSize(255)"`
|
||||||
IncludesAllRepositories *bool `json:"includes_all_repositories"`
|
IncludesAllRepositories *bool `json:"includes_all_repositories"`
|
||||||
// enum: read,write,admin
|
// enum: ["read", "write", "admin"]
|
||||||
Permission string `json:"permission"`
|
Permission string `json:"permission"`
|
||||||
// example: ["repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.pulls","repo.releases","repo.projects","repo.ext_wiki"]
|
// example: ["repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.pulls","repo.releases","repo.projects","repo.ext_wiki"]
|
||||||
// Deprecated: This variable should be replaced by UnitsMap and will be dropped in later versions.
|
// Deprecated: This variable should be replaced by UnitsMap and will be dropped in later versions.
|
||||||
|
|
|
@ -109,7 +109,7 @@ type Repository struct {
|
||||||
Internal bool `json:"internal"`
|
Internal bool `json:"internal"`
|
||||||
MirrorInterval string `json:"mirror_interval"`
|
MirrorInterval string `json:"mirror_interval"`
|
||||||
// ObjectFormatName of the underlying git repository
|
// ObjectFormatName of the underlying git repository
|
||||||
// enum: sha1,sha256
|
// enum: ["sha1", "sha256"]
|
||||||
ObjectFormatName string `json:"object_format_name"`
|
ObjectFormatName string `json:"object_format_name"`
|
||||||
// swagger:strfmt date-time
|
// swagger:strfmt date-time
|
||||||
MirrorUpdated time.Time `json:"mirror_updated,omitempty"`
|
MirrorUpdated time.Time `json:"mirror_updated,omitempty"`
|
||||||
|
@ -154,10 +154,10 @@ type CreateRepoOption struct {
|
||||||
// DefaultBranch of the repository (used when initializes and in template)
|
// DefaultBranch of the repository (used when initializes and in template)
|
||||||
DefaultBranch string `json:"default_branch" binding:"GitRefName;MaxSize(100)"`
|
DefaultBranch string `json:"default_branch" binding:"GitRefName;MaxSize(100)"`
|
||||||
// TrustModel of the repository
|
// TrustModel of the repository
|
||||||
// enum: default,collaborator,committer,collaboratorcommitter
|
// enum: ["default", "collaborator", "committer", "collaboratorcommitter"]
|
||||||
TrustModel string `json:"trust_model"`
|
TrustModel string `json:"trust_model"`
|
||||||
// ObjectFormatName of the underlying git repository
|
// ObjectFormatName of the underlying git repository
|
||||||
// enum: sha1,sha256
|
// enum: ["sha1", "sha256"]
|
||||||
ObjectFormatName string `json:"object_format_name" binding:"MaxSize(6)"`
|
ObjectFormatName string `json:"object_format_name" binding:"MaxSize(6)"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -359,7 +359,7 @@ type MigrateRepoOptions struct {
|
||||||
// required: true
|
// required: true
|
||||||
RepoName string `json:"repo_name" binding:"Required;AlphaDashDot;MaxSize(100)"`
|
RepoName string `json:"repo_name" binding:"Required;AlphaDashDot;MaxSize(100)"`
|
||||||
|
|
||||||
// enum: git,github,gitea,gitlab,gogs,onedev,gitbucket,codebase
|
// enum: ["git", "github", "gitea", "gitlab", "gogs", "onedev", "gitbucket", "codebase"]
|
||||||
Service string `json:"service"`
|
Service string `json:"service"`
|
||||||
AuthUsername string `json:"auth_username"`
|
AuthUsername string `json:"auth_username"`
|
||||||
AuthPassword string `json:"auth_password"`
|
AuthPassword string `json:"auth_password"`
|
||||||
|
|
|
@ -5,7 +5,7 @@ package structs
|
||||||
|
|
||||||
// AddCollaboratorOption options when adding a user as a collaborator of a repository
|
// AddCollaboratorOption options when adding a user as a collaborator of a repository
|
||||||
type AddCollaboratorOption struct {
|
type AddCollaboratorOption struct {
|
||||||
// enum: read,write,admin
|
// enum: ["read", "write", "admin"]
|
||||||
Permission *string `json:"permission"`
|
Permission *string `json:"permission"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ func (o *UpdateFileOptions) Branch() string {
|
||||||
type ChangeFileOperation struct {
|
type ChangeFileOperation struct {
|
||||||
// indicates what to do with the file
|
// indicates what to do with the file
|
||||||
// required: true
|
// required: true
|
||||||
// enum: create,update,delete
|
// enum: ["create", "update", "delete"]
|
||||||
Operation string `json:"operation" binding:"Required"`
|
Operation string `json:"operation" binding:"Required"`
|
||||||
// path to the existing or new file
|
// path to the existing or new file
|
||||||
// required: true
|
// required: true
|
||||||
|
|
|
@ -429,7 +429,7 @@ func (f *InitializeLabelsForm) Validate(req *http.Request, errs binding.Errors)
|
||||||
// swagger:model MergePullRequestOption
|
// swagger:model MergePullRequestOption
|
||||||
type MergePullRequestForm struct {
|
type MergePullRequestForm struct {
|
||||||
// required: true
|
// required: true
|
||||||
// enum: merge,rebase,rebase-merge,squash,fast-forward-only,manually-merged
|
// enum: ["merge", "rebase", "rebase-merge", "squash", "fast-forward-only", "manually-merged"]
|
||||||
Do string `binding:"Required;In(merge,rebase,rebase-merge,squash,fast-forward-only,manually-merged)"`
|
Do string `binding:"Required;In(merge,rebase,rebase-merge,squash,fast-forward-only,manually-merged)"`
|
||||||
MergeTitleField string
|
MergeTitleField string
|
||||||
MergeMessageField string
|
MergeMessageField string
|
||||||
|
|
Loading…
Reference in a new issue