mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-03-02 23:43:13 +01:00
Improve Swagger documentation for user endpoints
This commit is contained in:
parent
1316f4d338
commit
b074e08f34
23 changed files with 703 additions and 2 deletions
|
@ -68,6 +68,10 @@ func ListMyOrgs(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/OrganizationList"
|
// "$ref": "#/responses/OrganizationList"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
|
|
|
@ -91,6 +91,10 @@ func ListUserTeams(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/TeamList"
|
// "$ref": "#/responses/TeamList"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
teams, count, err := organization.SearchTeam(ctx, &organization.SearchTeamOptions{
|
teams, count, err := organization.SearchTeam(ctx, &organization.SearchTeamOptions{
|
||||||
ListOptions: utils.GetListOptions(ctx),
|
ListOptions: utils.GetListOptions(ctx),
|
||||||
|
|
|
@ -217,6 +217,10 @@ func GetStopwatches(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/StopWatchList"
|
// "$ref": "#/responses/StopWatchList"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
sws, err := issues_model.GetUserStopwatches(ctx, ctx.Doer.ID, utils.GetListOptions(ctx))
|
sws, err := issues_model.GetUserStopwatches(ctx, ctx.Doer.ID, utils.GetListOptions(ctx))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -599,6 +599,10 @@ func ListMyTrackedTimes(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/TrackedTimeList"
|
// "$ref": "#/responses/TrackedTimeList"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
opts := &issues_model.FindTrackedTimesOptions{
|
opts := &issues_model.FindTrackedTimesOptions{
|
||||||
ListOptions: utils.GetListOptions(ctx),
|
ListOptions: utils.GetListOptions(ctx),
|
||||||
|
|
|
@ -304,6 +304,10 @@ func Create(ctx *context.APIContext) {
|
||||||
// "$ref": "#/responses/Repository"
|
// "$ref": "#/responses/Repository"
|
||||||
// "400":
|
// "400":
|
||||||
// "$ref": "#/responses/error"
|
// "$ref": "#/responses/error"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "409":
|
// "409":
|
||||||
// description: The repository with the same name already exists.
|
// description: The repository with the same name already exists.
|
||||||
// "413":
|
// "413":
|
||||||
|
|
|
@ -44,6 +44,10 @@ func CreateOrUpdateSecret(ctx *context.APIContext) {
|
||||||
// description: response when updating a secret
|
// description: response when updating a secret
|
||||||
// "400":
|
// "400":
|
||||||
// "$ref": "#/responses/error"
|
// "$ref": "#/responses/error"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
|
@ -88,6 +92,10 @@ func DeleteSecret(ctx *context.APIContext) {
|
||||||
// description: delete one secret of the user
|
// description: delete one secret of the user
|
||||||
// "400":
|
// "400":
|
||||||
// "$ref": "#/responses/error"
|
// "$ref": "#/responses/error"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
|
@ -132,6 +140,10 @@ func CreateVariable(ctx *context.APIContext) {
|
||||||
// description: response when creating a variable
|
// description: response when creating a variable
|
||||||
// "400":
|
// "400":
|
||||||
// "$ref": "#/responses/error"
|
// "$ref": "#/responses/error"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
|
@ -191,6 +203,10 @@ func UpdateVariable(ctx *context.APIContext) {
|
||||||
// description: response when updating a variable
|
// description: response when updating a variable
|
||||||
// "400":
|
// "400":
|
||||||
// "$ref": "#/responses/error"
|
// "$ref": "#/responses/error"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
|
@ -244,6 +260,10 @@ func DeleteVariable(ctx *context.APIContext) {
|
||||||
// description: response when deleting a variable
|
// description: response when deleting a variable
|
||||||
// "400":
|
// "400":
|
||||||
// "$ref": "#/responses/error"
|
// "$ref": "#/responses/error"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
|
@ -279,6 +299,10 @@ func GetVariable(ctx *context.APIContext) {
|
||||||
// "$ref": "#/responses/ActionVariable"
|
// "$ref": "#/responses/ActionVariable"
|
||||||
// "400":
|
// "400":
|
||||||
// "$ref": "#/responses/error"
|
// "$ref": "#/responses/error"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
|
@ -326,6 +350,10 @@ func ListVariables(ctx *context.APIContext) {
|
||||||
// "$ref": "#/responses/VariableList"
|
// "$ref": "#/responses/VariableList"
|
||||||
// "400":
|
// "400":
|
||||||
// "$ref": "#/responses/error"
|
// "$ref": "#/responses/error"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,8 @@ func ListAccessTokens(ctx *context.APIContext) {
|
||||||
// "$ref": "#/responses/AccessTokenList"
|
// "$ref": "#/responses/AccessTokenList"
|
||||||
// "403":
|
// "403":
|
||||||
// "$ref": "#/responses/forbidden"
|
// "$ref": "#/responses/forbidden"
|
||||||
|
// "404":
|
||||||
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
opts := auth_model.ListAccessTokensOptions{UserID: ctx.ContextUser.ID, ListOptions: utils.GetListOptions(ctx)}
|
opts := auth_model.ListAccessTokensOptions{UserID: ctx.ContextUser.ID, ListOptions: utils.GetListOptions(ctx)}
|
||||||
|
|
||||||
|
@ -95,6 +97,8 @@ func CreateAccessToken(ctx *context.APIContext) {
|
||||||
// "$ref": "#/responses/error"
|
// "$ref": "#/responses/error"
|
||||||
// "403":
|
// "403":
|
||||||
// "$ref": "#/responses/forbidden"
|
// "$ref": "#/responses/forbidden"
|
||||||
|
// "404":
|
||||||
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
form := web.GetForm(ctx).(*api.CreateAccessTokenOption)
|
form := web.GetForm(ctx).(*api.CreateAccessTokenOption)
|
||||||
|
|
||||||
|
@ -224,6 +228,10 @@ func CreateOauth2Application(ctx *context.APIContext) {
|
||||||
// "$ref": "#/responses/OAuth2Application"
|
// "$ref": "#/responses/OAuth2Application"
|
||||||
// "400":
|
// "400":
|
||||||
// "$ref": "#/responses/error"
|
// "$ref": "#/responses/error"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
data := web.GetForm(ctx).(*api.CreateOAuth2ApplicationOptions)
|
data := web.GetForm(ctx).(*api.CreateOAuth2ApplicationOptions)
|
||||||
|
|
||||||
|
@ -266,6 +274,10 @@ func ListOauth2Applications(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/OAuth2ApplicationList"
|
// "$ref": "#/responses/OAuth2ApplicationList"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
apps, total, err := db.FindAndCount[auth_model.OAuth2Application](ctx, auth_model.FindOAuth2ApplicationsOptions{
|
apps, total, err := db.FindAndCount[auth_model.OAuth2Application](ctx, auth_model.FindOAuth2ApplicationsOptions{
|
||||||
ListOptions: utils.GetListOptions(ctx),
|
ListOptions: utils.GetListOptions(ctx),
|
||||||
|
@ -303,6 +315,10 @@ func DeleteOauth2Application(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "204":
|
// "204":
|
||||||
// "$ref": "#/responses/empty"
|
// "$ref": "#/responses/empty"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
appID := ctx.ParamsInt64(":id")
|
appID := ctx.ParamsInt64(":id")
|
||||||
|
@ -335,6 +351,10 @@ func GetOauth2Application(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/OAuth2Application"
|
// "$ref": "#/responses/OAuth2Application"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
appID := ctx.ParamsInt64(":id")
|
appID := ctx.ParamsInt64(":id")
|
||||||
|
@ -379,6 +399,10 @@ func UpdateOauth2Application(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/OAuth2Application"
|
// "$ref": "#/responses/OAuth2Application"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
appID := ctx.ParamsInt64(":id")
|
appID := ctx.ParamsInt64(":id")
|
||||||
|
|
|
@ -28,6 +28,10 @@ func UpdateAvatar(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "204":
|
// "204":
|
||||||
// "$ref": "#/responses/empty"
|
// "$ref": "#/responses/empty"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
form := web.GetForm(ctx).(*api.UpdateUserAvatarOption)
|
form := web.GetForm(ctx).(*api.UpdateUserAvatarOption)
|
||||||
|
|
||||||
content, err := base64.StdEncoding.DecodeString(form.Image)
|
content, err := base64.StdEncoding.DecodeString(form.Image)
|
||||||
|
@ -55,6 +59,10 @@ func DeleteAvatar(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "204":
|
// "204":
|
||||||
// "$ref": "#/responses/empty"
|
// "$ref": "#/responses/empty"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
err := user_service.DeleteAvatar(ctx, ctx.Doer)
|
err := user_service.DeleteAvatar(ctx, ctx.Doer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.Error(http.StatusInternalServerError, "DeleteAvatar", err)
|
ctx.Error(http.StatusInternalServerError, "DeleteAvatar", err)
|
||||||
|
|
|
@ -27,6 +27,10 @@ func ListEmails(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/EmailList"
|
// "$ref": "#/responses/EmailList"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
emails, err := user_model.GetEmailAddresses(ctx, ctx.Doer.ID)
|
emails, err := user_model.GetEmailAddresses(ctx, ctx.Doer.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -55,6 +59,10 @@ func AddEmail(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// '201':
|
// '201':
|
||||||
// "$ref": "#/responses/EmailList"
|
// "$ref": "#/responses/EmailList"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "422":
|
// "422":
|
||||||
// "$ref": "#/responses/validationError"
|
// "$ref": "#/responses/validationError"
|
||||||
|
|
||||||
|
@ -112,6 +120,10 @@ func DeleteEmail(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "204":
|
// "204":
|
||||||
// "$ref": "#/responses/empty"
|
// "$ref": "#/responses/empty"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,10 @@ func ListMyFollowers(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/UserList"
|
// "$ref": "#/responses/UserList"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
listUserFollowers(ctx, ctx.Doer)
|
listUserFollowers(ctx, ctx.Doer)
|
||||||
}
|
}
|
||||||
|
@ -117,6 +121,10 @@ func ListMyFollowing(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/UserList"
|
// "$ref": "#/responses/UserList"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
listUserFollowing(ctx, ctx.Doer)
|
listUserFollowing(ctx, ctx.Doer)
|
||||||
}
|
}
|
||||||
|
@ -173,6 +181,10 @@ func CheckMyFollowing(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "204":
|
// "204":
|
||||||
// "$ref": "#/responses/empty"
|
// "$ref": "#/responses/empty"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
|
@ -222,10 +234,12 @@ func Follow(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "204":
|
// "204":
|
||||||
// "$ref": "#/responses/empty"
|
// "$ref": "#/responses/empty"
|
||||||
// "404":
|
// "401":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/unauthorized"
|
||||||
// "403":
|
// "403":
|
||||||
// "$ref": "#/responses/forbidden"
|
// "$ref": "#/responses/forbidden"
|
||||||
|
// "404":
|
||||||
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
if err := user_model.FollowUser(ctx, ctx.Doer.ID, ctx.ContextUser.ID); err != nil {
|
if err := user_model.FollowUser(ctx, ctx.Doer.ID, ctx.ContextUser.ID); err != nil {
|
||||||
if errors.Is(err, user_model.ErrBlockedByUser) {
|
if errors.Is(err, user_model.ErrBlockedByUser) {
|
||||||
|
@ -252,6 +266,10 @@ func Unfollow(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "204":
|
// "204":
|
||||||
// "$ref": "#/responses/empty"
|
// "$ref": "#/responses/empty"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
|
|
|
@ -92,6 +92,10 @@ func ListMyGPGKeys(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/GPGKeyList"
|
// "$ref": "#/responses/GPGKeyList"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
listGPGKeys(ctx, ctx.Doer.ID, utils.GetListOptions(ctx))
|
listGPGKeys(ctx, ctx.Doer.ID, utils.GetListOptions(ctx))
|
||||||
}
|
}
|
||||||
|
@ -113,6 +117,10 @@ func GetGPGKey(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/GPGKey"
|
// "$ref": "#/responses/GPGKey"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
|
@ -164,6 +172,10 @@ func GetVerificationToken(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/string"
|
// "$ref": "#/responses/string"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
|
@ -183,6 +195,10 @@ func VerifyUserGPGKey(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "201":
|
// "201":
|
||||||
// "$ref": "#/responses/GPGKey"
|
// "$ref": "#/responses/GPGKey"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
// "422":
|
// "422":
|
||||||
|
@ -244,6 +260,10 @@ func CreateGPGKey(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "201":
|
// "201":
|
||||||
// "$ref": "#/responses/GPGKey"
|
// "$ref": "#/responses/GPGKey"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
// "422":
|
// "422":
|
||||||
|
@ -270,6 +290,8 @@ func DeleteGPGKey(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "204":
|
// "204":
|
||||||
// "$ref": "#/responses/empty"
|
// "$ref": "#/responses/empty"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
// "403":
|
// "403":
|
||||||
// "$ref": "#/responses/forbidden"
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
|
|
|
@ -32,6 +32,10 @@ func ListHooks(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/HookList"
|
// "$ref": "#/responses/HookList"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
utils.ListOwnerHooks(
|
utils.ListOwnerHooks(
|
||||||
ctx,
|
ctx,
|
||||||
|
@ -56,6 +60,10 @@ func GetHook(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/Hook"
|
// "$ref": "#/responses/Hook"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
hook, err := utils.GetOwnerHook(ctx, ctx.Doer.ID, ctx.ParamsInt64("id"))
|
hook, err := utils.GetOwnerHook(ctx, ctx.Doer.ID, ctx.ParamsInt64("id"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -93,6 +101,10 @@ func CreateHook(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "201":
|
// "201":
|
||||||
// "$ref": "#/responses/Hook"
|
// "$ref": "#/responses/Hook"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
utils.AddOwnerHook(
|
utils.AddOwnerHook(
|
||||||
ctx,
|
ctx,
|
||||||
|
@ -124,6 +136,10 @@ func EditHook(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/Hook"
|
// "$ref": "#/responses/Hook"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
utils.EditOwnerHook(
|
utils.EditOwnerHook(
|
||||||
ctx,
|
ctx,
|
||||||
|
@ -150,6 +166,10 @@ func DeleteHook(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "204":
|
// "204":
|
||||||
// "$ref": "#/responses/empty"
|
// "$ref": "#/responses/empty"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
utils.DeleteOwnerHook(
|
utils.DeleteOwnerHook(
|
||||||
ctx,
|
ctx,
|
||||||
|
|
|
@ -121,6 +121,10 @@ func ListMyPublicKeys(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/PublicKeyList"
|
// "$ref": "#/responses/PublicKeyList"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
listPublicKeys(ctx, ctx.Doer)
|
listPublicKeys(ctx, ctx.Doer)
|
||||||
}
|
}
|
||||||
|
@ -176,6 +180,10 @@ func GetPublicKey(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/PublicKey"
|
// "$ref": "#/responses/PublicKey"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
|
@ -240,6 +248,10 @@ func CreatePublicKey(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "201":
|
// "201":
|
||||||
// "$ref": "#/responses/PublicKey"
|
// "$ref": "#/responses/PublicKey"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "422":
|
// "422":
|
||||||
// "$ref": "#/responses/validationError"
|
// "$ref": "#/responses/validationError"
|
||||||
|
|
||||||
|
@ -264,6 +276,8 @@ func DeletePublicKey(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "204":
|
// "204":
|
||||||
// "$ref": "#/responses/empty"
|
// "$ref": "#/responses/empty"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
// "403":
|
// "403":
|
||||||
// "$ref": "#/responses/forbidden"
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
|
|
|
@ -18,6 +18,8 @@ func GetQuota(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/QuotaInfo"
|
// "$ref": "#/responses/QuotaInfo"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
// "403":
|
// "403":
|
||||||
// "$ref": "#/responses/forbidden"
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
|
@ -34,6 +36,8 @@ func CheckQuota(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/boolean"
|
// "$ref": "#/responses/boolean"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
// "403":
|
// "403":
|
||||||
// "$ref": "#/responses/forbidden"
|
// "$ref": "#/responses/forbidden"
|
||||||
// "422":
|
// "422":
|
||||||
|
@ -61,6 +65,8 @@ func ListQuotaAttachments(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/QuotaUsedAttachmentList"
|
// "$ref": "#/responses/QuotaUsedAttachmentList"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
// "403":
|
// "403":
|
||||||
// "$ref": "#/responses/forbidden"
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
|
@ -86,6 +92,8 @@ func ListQuotaPackages(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/QuotaUsedPackageList"
|
// "$ref": "#/responses/QuotaUsedPackageList"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
// "403":
|
// "403":
|
||||||
// "$ref": "#/responses/forbidden"
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
|
@ -111,6 +119,8 @@ func ListQuotaArtifacts(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/QuotaUsedArtifactList"
|
// "$ref": "#/responses/QuotaUsedArtifactList"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
// "403":
|
// "403":
|
||||||
// "$ref": "#/responses/forbidden"
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
|
|
|
@ -106,6 +106,10 @@ func ListMyRepos(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/RepositoryList"
|
// "$ref": "#/responses/RepositoryList"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "422":
|
// "422":
|
||||||
// "$ref": "#/responses/validationError"
|
// "$ref": "#/responses/validationError"
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,10 @@ func GetRegistrationToken(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/RegistrationToken"
|
// "$ref": "#/responses/RegistrationToken"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
shared.GetRegistrationToken(ctx, ctx.Doer.ID, 0)
|
shared.GetRegistrationToken(ctx, ctx.Doer.ID, 0)
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,10 @@ func GetUserSettings(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/UserSettings"
|
// "$ref": "#/responses/UserSettings"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
ctx.JSON(http.StatusOK, convert.User2UserSettings(ctx.Doer))
|
ctx.JSON(http.StatusOK, convert.User2UserSettings(ctx.Doer))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,6 +46,10 @@ func UpdateUserSettings(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/UserSettings"
|
// "$ref": "#/responses/UserSettings"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
form := web.GetForm(ctx).(*api.UserSettingsOptions)
|
form := web.GetForm(ctx).(*api.UserSettingsOptions)
|
||||||
|
|
||||||
|
|
|
@ -96,6 +96,10 @@ func GetMyStarredRepos(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/RepositoryList"
|
// "$ref": "#/responses/RepositoryList"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
repos, err := getStarredRepos(ctx, ctx.Doer, true, utils.GetListOptions(ctx))
|
repos, err := getStarredRepos(ctx, ctx.Doer, true, utils.GetListOptions(ctx))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -125,6 +129,10 @@ func IsStarring(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "204":
|
// "204":
|
||||||
// "$ref": "#/responses/empty"
|
// "$ref": "#/responses/empty"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
|
@ -154,6 +162,10 @@ func Star(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "204":
|
// "204":
|
||||||
// "$ref": "#/responses/empty"
|
// "$ref": "#/responses/empty"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
|
@ -185,6 +197,10 @@ func Unstar(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "204":
|
// "204":
|
||||||
// "$ref": "#/responses/empty"
|
// "$ref": "#/responses/empty"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
|
|
|
@ -137,6 +137,10 @@ func GetAuthenticatedUser(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/User"
|
// "$ref": "#/responses/User"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
ctx.JSON(http.StatusOK, convert.ToUser(ctx, ctx.Doer, ctx.Doer))
|
ctx.JSON(http.StatusOK, convert.ToUser(ctx, ctx.Doer, ctx.Doer))
|
||||||
}
|
}
|
||||||
|
@ -244,6 +248,10 @@ func ListBlockedUsers(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/BlockedUserList"
|
// "$ref": "#/responses/BlockedUserList"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
utils.ListUserBlockedUsers(ctx, ctx.Doer)
|
utils.ListUserBlockedUsers(ctx, ctx.Doer)
|
||||||
}
|
}
|
||||||
|
@ -264,6 +272,10 @@ func BlockUser(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "204":
|
// "204":
|
||||||
// "$ref": "#/responses/empty"
|
// "$ref": "#/responses/empty"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
// "422":
|
// "422":
|
||||||
|
@ -293,6 +305,10 @@ func UnblockUser(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "204":
|
// "204":
|
||||||
// "$ref": "#/responses/empty"
|
// "$ref": "#/responses/empty"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
// "422":
|
// "422":
|
||||||
|
|
|
@ -91,6 +91,10 @@ func GetMyWatchedRepos(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/RepositoryList"
|
// "$ref": "#/responses/RepositoryList"
|
||||||
|
// "401":
|
||||||
|
// "$ref": "#/responses/unauthorized"
|
||||||
|
// "403":
|
||||||
|
// "$ref": "#/responses/forbidden"
|
||||||
|
|
||||||
repos, total, err := getWatchedRepos(ctx, ctx.Doer, true, utils.GetListOptions(ctx))
|
repos, total, err := getWatchedRepos(ctx, ctx.Doer, true, utils.GetListOptions(ctx))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -99,6 +99,17 @@ type swaggerAPIInvalidTopicsError struct {
|
||||||
// swagger:response empty
|
// swagger:response empty
|
||||||
type APIEmpty struct{}
|
type APIEmpty struct{}
|
||||||
|
|
||||||
|
type APIUnauthorizedError struct {
|
||||||
|
APIError
|
||||||
|
}
|
||||||
|
|
||||||
|
// APIUnauthorizedError is a unauthorized error response
|
||||||
|
// swagger:response unauthorized
|
||||||
|
type swaggerAPUnauthorizedError struct {
|
||||||
|
// in:body
|
||||||
|
Body APIUnauthorizedError `json:"body"`
|
||||||
|
}
|
||||||
|
|
||||||
type APIForbiddenError struct {
|
type APIForbiddenError struct {
|
||||||
APIError
|
APIError
|
||||||
}
|
}
|
||||||
|
|
362
templates/swagger/v1_json.tmpl
generated
362
templates/swagger/v1_json.tmpl
generated
|
@ -17315,6 +17315,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/User"
|
"$ref": "#/responses/User"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17332,6 +17338,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/RegistrationToken"
|
"$ref": "#/responses/RegistrationToken"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17375,6 +17387,12 @@
|
||||||
"400": {
|
"400": {
|
||||||
"$ref": "#/responses/error"
|
"$ref": "#/responses/error"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -17408,6 +17426,12 @@
|
||||||
"400": {
|
"400": {
|
||||||
"$ref": "#/responses/error"
|
"$ref": "#/responses/error"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -17445,6 +17469,12 @@
|
||||||
"400": {
|
"400": {
|
||||||
"$ref": "#/responses/error"
|
"$ref": "#/responses/error"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -17477,6 +17507,12 @@
|
||||||
"400": {
|
"400": {
|
||||||
"$ref": "#/responses/error"
|
"$ref": "#/responses/error"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -17520,6 +17556,12 @@
|
||||||
"400": {
|
"400": {
|
||||||
"$ref": "#/responses/error"
|
"$ref": "#/responses/error"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -17563,6 +17605,12 @@
|
||||||
"400": {
|
"400": {
|
||||||
"$ref": "#/responses/error"
|
"$ref": "#/responses/error"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -17596,6 +17644,12 @@
|
||||||
"400": {
|
"400": {
|
||||||
"$ref": "#/responses/error"
|
"$ref": "#/responses/error"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -17629,6 +17683,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/OAuth2ApplicationList"
|
"$ref": "#/responses/OAuth2ApplicationList"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -17657,6 +17717,12 @@
|
||||||
},
|
},
|
||||||
"400": {
|
"400": {
|
||||||
"$ref": "#/responses/error"
|
"$ref": "#/responses/error"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17685,6 +17751,12 @@
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/OAuth2Application"
|
"$ref": "#/responses/OAuth2Application"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -17713,6 +17785,12 @@
|
||||||
"204": {
|
"204": {
|
||||||
"$ref": "#/responses/empty"
|
"$ref": "#/responses/empty"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -17749,6 +17827,12 @@
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/OAuth2Application"
|
"$ref": "#/responses/OAuth2Application"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -17777,6 +17861,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"204": {
|
"204": {
|
||||||
"$ref": "#/responses/empty"
|
"$ref": "#/responses/empty"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -17792,6 +17882,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"204": {
|
"204": {
|
||||||
"$ref": "#/responses/empty"
|
"$ref": "#/responses/empty"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17819,6 +17915,12 @@
|
||||||
"204": {
|
"204": {
|
||||||
"$ref": "#/responses/empty"
|
"$ref": "#/responses/empty"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
},
|
},
|
||||||
|
@ -17841,6 +17943,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/EmailList"
|
"$ref": "#/responses/EmailList"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -17866,6 +17974,12 @@
|
||||||
"201": {
|
"201": {
|
||||||
"$ref": "#/responses/EmailList"
|
"$ref": "#/responses/EmailList"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"422": {
|
"422": {
|
||||||
"$ref": "#/responses/validationError"
|
"$ref": "#/responses/validationError"
|
||||||
}
|
}
|
||||||
|
@ -17893,6 +18007,12 @@
|
||||||
"204": {
|
"204": {
|
||||||
"$ref": "#/responses/empty"
|
"$ref": "#/responses/empty"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -17926,6 +18046,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/UserList"
|
"$ref": "#/responses/UserList"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17957,6 +18083,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/UserList"
|
"$ref": "#/responses/UserList"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17981,6 +18113,12 @@
|
||||||
"204": {
|
"204": {
|
||||||
"$ref": "#/responses/empty"
|
"$ref": "#/responses/empty"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -18005,6 +18143,9 @@
|
||||||
"204": {
|
"204": {
|
||||||
"$ref": "#/responses/empty"
|
"$ref": "#/responses/empty"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
"403": {
|
"403": {
|
||||||
"$ref": "#/responses/forbidden"
|
"$ref": "#/responses/forbidden"
|
||||||
},
|
},
|
||||||
|
@ -18032,6 +18173,12 @@
|
||||||
"204": {
|
"204": {
|
||||||
"$ref": "#/responses/empty"
|
"$ref": "#/responses/empty"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -18052,6 +18199,12 @@
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/string"
|
"$ref": "#/responses/string"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -18075,6 +18228,12 @@
|
||||||
"201": {
|
"201": {
|
||||||
"$ref": "#/responses/GPGKey"
|
"$ref": "#/responses/GPGKey"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
},
|
},
|
||||||
|
@ -18111,6 +18270,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/GPGKeyList"
|
"$ref": "#/responses/GPGKeyList"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -18139,6 +18304,12 @@
|
||||||
"201": {
|
"201": {
|
||||||
"$ref": "#/responses/GPGKey"
|
"$ref": "#/responses/GPGKey"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
},
|
},
|
||||||
|
@ -18172,6 +18343,12 @@
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/GPGKey"
|
"$ref": "#/responses/GPGKey"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -18200,6 +18377,9 @@
|
||||||
"204": {
|
"204": {
|
||||||
"$ref": "#/responses/empty"
|
"$ref": "#/responses/empty"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
"403": {
|
"403": {
|
||||||
"$ref": "#/responses/forbidden"
|
"$ref": "#/responses/forbidden"
|
||||||
},
|
},
|
||||||
|
@ -18236,6 +18416,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/HookList"
|
"$ref": "#/responses/HookList"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -18264,6 +18450,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"201": {
|
"201": {
|
||||||
"$ref": "#/responses/Hook"
|
"$ref": "#/responses/Hook"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18291,6 +18483,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/Hook"
|
"$ref": "#/responses/Hook"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -18316,6 +18514,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"204": {
|
"204": {
|
||||||
"$ref": "#/responses/empty"
|
"$ref": "#/responses/empty"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -18351,6 +18555,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/Hook"
|
"$ref": "#/responses/Hook"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18388,6 +18598,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/PublicKeyList"
|
"$ref": "#/responses/PublicKeyList"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -18416,6 +18632,12 @@
|
||||||
"201": {
|
"201": {
|
||||||
"$ref": "#/responses/PublicKey"
|
"$ref": "#/responses/PublicKey"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"422": {
|
"422": {
|
||||||
"$ref": "#/responses/validationError"
|
"$ref": "#/responses/validationError"
|
||||||
}
|
}
|
||||||
|
@ -18446,6 +18668,12 @@
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/PublicKey"
|
"$ref": "#/responses/PublicKey"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -18474,6 +18702,9 @@
|
||||||
"204": {
|
"204": {
|
||||||
"$ref": "#/responses/empty"
|
"$ref": "#/responses/empty"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
"403": {
|
"403": {
|
||||||
"$ref": "#/responses/forbidden"
|
"$ref": "#/responses/forbidden"
|
||||||
},
|
},
|
||||||
|
@ -18510,6 +18741,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/BlockedUserList"
|
"$ref": "#/responses/BlockedUserList"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18542,6 +18779,12 @@
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/OrganizationList"
|
"$ref": "#/responses/OrganizationList"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -18562,6 +18805,9 @@
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/QuotaInfo"
|
"$ref": "#/responses/QuotaInfo"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
"403": {
|
"403": {
|
||||||
"$ref": "#/responses/forbidden"
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
|
@ -18596,6 +18842,9 @@
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/QuotaUsedArtifactList"
|
"$ref": "#/responses/QuotaUsedArtifactList"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
"403": {
|
"403": {
|
||||||
"$ref": "#/responses/forbidden"
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
|
@ -18630,6 +18879,9 @@
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/QuotaUsedAttachmentList"
|
"$ref": "#/responses/QuotaUsedAttachmentList"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
"403": {
|
"403": {
|
||||||
"$ref": "#/responses/forbidden"
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
|
@ -18650,6 +18902,9 @@
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/boolean"
|
"$ref": "#/responses/boolean"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
"403": {
|
"403": {
|
||||||
"$ref": "#/responses/forbidden"
|
"$ref": "#/responses/forbidden"
|
||||||
},
|
},
|
||||||
|
@ -18687,6 +18942,9 @@
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/QuotaUsedPackageList"
|
"$ref": "#/responses/QuotaUsedPackageList"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
"403": {
|
"403": {
|
||||||
"$ref": "#/responses/forbidden"
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
|
@ -18727,6 +18985,12 @@
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/RepositoryList"
|
"$ref": "#/responses/RepositoryList"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"422": {
|
"422": {
|
||||||
"$ref": "#/responses/validationError"
|
"$ref": "#/responses/validationError"
|
||||||
}
|
}
|
||||||
|
@ -18761,6 +19025,12 @@
|
||||||
"400": {
|
"400": {
|
||||||
"$ref": "#/responses/error"
|
"$ref": "#/responses/error"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"409": {
|
"409": {
|
||||||
"description": "The repository with the same name already exists."
|
"description": "The repository with the same name already exists."
|
||||||
},
|
},
|
||||||
|
@ -18786,6 +19056,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/UserSettings"
|
"$ref": "#/responses/UserSettings"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -18810,6 +19086,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/UserSettings"
|
"$ref": "#/responses/UserSettings"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18841,6 +19123,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/RepositoryList"
|
"$ref": "#/responses/RepositoryList"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18872,6 +19160,12 @@
|
||||||
"204": {
|
"204": {
|
||||||
"$ref": "#/responses/empty"
|
"$ref": "#/responses/empty"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -18903,6 +19197,12 @@
|
||||||
"204": {
|
"204": {
|
||||||
"$ref": "#/responses/empty"
|
"$ref": "#/responses/empty"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -18934,6 +19234,12 @@
|
||||||
"204": {
|
"204": {
|
||||||
"$ref": "#/responses/empty"
|
"$ref": "#/responses/empty"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
@ -18970,6 +19276,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/StopWatchList"
|
"$ref": "#/responses/StopWatchList"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19001,6 +19313,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/RepositoryList"
|
"$ref": "#/responses/RepositoryList"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19032,6 +19350,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/TeamList"
|
"$ref": "#/responses/TeamList"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19077,6 +19401,12 @@
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/TrackedTimeList"
|
"$ref": "#/responses/TrackedTimeList"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19104,6 +19434,12 @@
|
||||||
"204": {
|
"204": {
|
||||||
"$ref": "#/responses/empty"
|
"$ref": "#/responses/empty"
|
||||||
},
|
},
|
||||||
|
"401": {
|
||||||
|
"$ref": "#/responses/unauthorized"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
},
|
},
|
||||||
|
@ -19726,6 +20062,9 @@
|
||||||
},
|
},
|
||||||
"403": {
|
"403": {
|
||||||
"$ref": "#/responses/forbidden"
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
|
"404": {
|
||||||
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -19766,6 +20105,9 @@
|
||||||
},
|
},
|
||||||
"403": {
|
"403": {
|
||||||
"$ref": "#/responses/forbidden"
|
"$ref": "#/responses/forbidden"
|
||||||
|
},
|
||||||
|
"404": {
|
||||||
|
"$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19912,6 +20254,20 @@
|
||||||
},
|
},
|
||||||
"x-go-package": "code.gitea.io/gitea/services/context"
|
"x-go-package": "code.gitea.io/gitea/services/context"
|
||||||
},
|
},
|
||||||
|
"APIUnauthorizedError": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"message": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "Message"
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "URL"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-go-package": "code.gitea.io/gitea/services/context"
|
||||||
|
},
|
||||||
"APIValidationError": {
|
"APIValidationError": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -28488,6 +28844,12 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"unauthorized": {
|
||||||
|
"description": "APIUnauthorizedError is a unauthorized error response",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/APIUnauthorizedError"
|
||||||
|
}
|
||||||
|
},
|
||||||
"validationError": {
|
"validationError": {
|
||||||
"description": "APIValidationError is error format response related to input validation",
|
"description": "APIValidationError is error format response related to input validation",
|
||||||
"schema": {
|
"schema": {
|
||||||
|
|
100
tests/integration/swagger_test.go
Normal file
100
tests/integration/swagger_test.go
Normal file
|
@ -0,0 +1,100 @@
|
||||||
|
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
package integration
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"code.gitea.io/gitea/modules/json"
|
||||||
|
"code.gitea.io/gitea/tests"
|
||||||
|
|
||||||
|
swagger_spec "github.com/go-openapi/spec"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
)
|
||||||
|
|
||||||
|
func getSwagger(t *testing.T) *swagger_spec.Swagger {
|
||||||
|
t.Helper()
|
||||||
|
|
||||||
|
resp := MakeRequest(t, NewRequest(t, "GET", "/swagger.v1.json"), http.StatusOK)
|
||||||
|
|
||||||
|
swagger := new(swagger_spec.Swagger)
|
||||||
|
|
||||||
|
decoder := json.NewDecoder(resp.Body)
|
||||||
|
require.NoError(t, decoder.Decode(swagger))
|
||||||
|
|
||||||
|
return swagger
|
||||||
|
}
|
||||||
|
|
||||||
|
func checkSwaggerMethodResponse(t *testing.T, path string, method *swagger_spec.Operation, name string, statusCode int, responseType string) {
|
||||||
|
t.Helper()
|
||||||
|
|
||||||
|
if method == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val, ok := method.Responses.StatusCodeResponses[statusCode]
|
||||||
|
if !ok {
|
||||||
|
t.Errorf("%s %s is missing response status code %d in swagger", name, path, statusCode)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if responseType != val.Ref.String() {
|
||||||
|
t.Errorf("%s %s has %s response type for %d in swagger (expected %s)", name, path, val.Ref.String(), statusCode, responseType)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func checkSwaggerPathResponse(t *testing.T, paths map[string]swagger_spec.PathItem, pathMatch string, statusCode int, responseType string) {
|
||||||
|
t.Helper()
|
||||||
|
|
||||||
|
for pathName, pathData := range paths {
|
||||||
|
if pathName != pathMatch {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
checkSwaggerMethodResponse(t, pathName, pathData.Get, "GET", statusCode, responseType)
|
||||||
|
checkSwaggerMethodResponse(t, pathName, pathData.Put, "PUT", statusCode, responseType)
|
||||||
|
checkSwaggerMethodResponse(t, pathName, pathData.Post, "POST", statusCode, responseType)
|
||||||
|
checkSwaggerMethodResponse(t, pathName, pathData.Patch, "PATCH", statusCode, responseType)
|
||||||
|
checkSwaggerMethodResponse(t, pathName, pathData.Delete, "DELETE", statusCode, responseType)
|
||||||
|
checkSwaggerMethodResponse(t, pathName, pathData.Options, "OPTIONS", statusCode, responseType)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func checkSwaggerRouteResponse(t *testing.T, paths map[string]swagger_spec.PathItem, prefix string, statusCode int, responseType string) {
|
||||||
|
t.Helper()
|
||||||
|
|
||||||
|
for pathName, pathData := range paths {
|
||||||
|
if !strings.HasPrefix(pathName, prefix) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
checkSwaggerMethodResponse(t, pathName, pathData.Get, "GET", statusCode, responseType)
|
||||||
|
checkSwaggerMethodResponse(t, pathName, pathData.Put, "PUT", statusCode, responseType)
|
||||||
|
checkSwaggerMethodResponse(t, pathName, pathData.Post, "POST", statusCode, responseType)
|
||||||
|
checkSwaggerMethodResponse(t, pathName, pathData.Patch, "PATCH", statusCode, responseType)
|
||||||
|
checkSwaggerMethodResponse(t, pathName, pathData.Delete, "DELETE", statusCode, responseType)
|
||||||
|
checkSwaggerMethodResponse(t, pathName, pathData.Options, "OPTIONS", statusCode, responseType)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestSwaggerUserRoute(t *testing.T) {
|
||||||
|
defer tests.PrepareTestEnv(t)()
|
||||||
|
|
||||||
|
swagger := getSwagger(t)
|
||||||
|
|
||||||
|
checkSwaggerPathResponse(t, swagger.Paths.Paths, "/user", http.StatusUnauthorized, "#/responses/unauthorized")
|
||||||
|
checkSwaggerRouteResponse(t, swagger.Paths.Paths, "/user/", http.StatusUnauthorized, "#/responses/unauthorized")
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestSwaggerUsersRoute(t *testing.T) {
|
||||||
|
defer tests.PrepareTestEnv(t)()
|
||||||
|
|
||||||
|
swagger := getSwagger(t)
|
||||||
|
|
||||||
|
checkSwaggerRouteResponse(t, swagger.Paths.Paths, "/users/{username}", http.StatusNotFound, "#/responses/notFound")
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue