Update token creation API swagger documentation (#34288) (#34296)

Backport #34288 by @lunny

Fix #34231

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
Giteabot 2025-04-28 10:34:46 +08:00 committed by GitHub
parent 4e5aca62ee
commit 4f6d09fb68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 2 deletions

View File

@ -23,9 +23,11 @@ type AccessToken struct {
type AccessTokenList []*AccessToken
// CreateAccessTokenOption options when create access token
// swagger:model CreateAccessTokenOption
type CreateAccessTokenOption struct {
// required: true
Name string `json:"name" binding:"Required"`
// example: ["all", "read:activitypub","read:issue", "write:misc", "read:notification", "read:organization", "read:package", "read:repository", "read:user"]
Scopes []string `json:"scopes"`
}

View File

@ -19616,7 +19616,18 @@
"items": {
"type": "string"
},
"x-go-name": "Scopes"
"x-go-name": "Scopes",
"example": [
"all",
"read:activitypub",
"read:issue",
"write:misc",
"read:notification",
"read:organization",
"read:package",
"read:repository",
"read:user"
]
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"