Update token creation API swagger documentation (#34288)

Fix #34231
This commit is contained in:
Lunny Xiao 2025-04-26 22:32:15 -07:00 committed by GitHub
parent bf8f111f53
commit 0376c09fc2
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"`
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

@ -21350,7 +21350,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"