From 5671c5192deb2b97f5cbeedd4e54a04029caa401 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Wed, 28 Oct 2026 17:05:00 +0800 Subject: [PATCH] refactor: use default error response for swagger (#40048) ref: https://github.com/go-gitea/gitea/pull/39942#discussion_r4393487959 --- docs/guidelines-backend.md | 4 +- routers/api/v1/admin/action.go | 10 +- routers/api/v1/admin/adopt.go | 14 +- routers/api/v1/admin/cron.go | 8 +- routers/api/v1/admin/email.go | 8 +- routers/api/v1/admin/org.go | 10 +- routers/api/v1/admin/packages.go | 4 +- routers/api/v1/admin/repo.go | 10 +- routers/api/v1/admin/runners.go | 18 +- routers/api/v1/admin/user.go | 48 +- routers/api/v1/admin/user_badge.go | 14 +- routers/api/v1/misc/gitignore.go | 4 +- routers/api/v1/misc/label_templates.go | 4 +- routers/api/v1/misc/licenses.go | 4 +- routers/api/v1/misc/markup.go | 12 +- routers/api/v1/notify/threads.go | 12 +- routers/api/v1/org/action.go | 60 +- routers/api/v1/org/avatar.go | 8 +- routers/api/v1/org/block.go | 16 +- routers/api/v1/org/hook.go | 20 +- routers/api/v1/org/label.go | 24 +- routers/api/v1/org/member.go | 32 +- routers/api/v1/org/org.go | 48 +- routers/api/v1/org/team.go | 68 +- routers/api/v1/packages/package.go | 36 +- routers/api/v1/repo/action.go | 200 +- routers/api/v1/repo/actions_run.go | 32 +- routers/api/v1/repo/avatar.go | 8 +- routers/api/v1/repo/blob.go | 4 +- routers/api/v1/repo/branch.go | 78 +- routers/api/v1/repo/collaborators.go | 42 +- routers/api/v1/repo/commits.go | 20 +- routers/api/v1/repo/compare.go | 4 +- routers/api/v1/repo/file.go | 70 +- routers/api/v1/repo/fork.go | 14 +- routers/api/v1/repo/git_hook.go | 16 +- routers/api/v1/repo/git_ref.go | 8 +- routers/api/v1/repo/hook.go | 32 +- routers/api/v1/repo/issue.go | 44 +- routers/api/v1/repo/issue_assignee.go | 20 +- routers/api/v1/repo/issue_attachment.go | 24 +- routers/api/v1/repo/issue_comment.go | 52 +- .../api/v1/repo/issue_comment_attachment.go | 26 +- routers/api/v1/repo/issue_dependency.go | 28 +- routers/api/v1/repo/issue_label.go | 38 +- routers/api/v1/repo/issue_lock.go | 12 +- routers/api/v1/repo/issue_pin.go | 30 +- routers/api/v1/repo/issue_reaction.go | 36 +- routers/api/v1/repo/issue_stopwatch.go | 24 +- routers/api/v1/repo/issue_subscription.go | 16 +- routers/api/v1/repo/issue_tracked_time.go | 34 +- routers/api/v1/repo/key.go | 26 +- routers/api/v1/repo/label.go | 24 +- routers/api/v1/repo/language.go | 4 +- routers/api/v1/repo/license.go | 4 +- routers/api/v1/repo/migrate.go | 8 +- routers/api/v1/repo/milestone.go | 20 +- routers/api/v1/repo/mirror.go | 36 +- routers/api/v1/repo/notes.go | 6 +- routers/api/v1/repo/patch.go | 6 +- routers/api/v1/repo/pull.go | 76 +- routers/api/v1/repo/pull_review.go | 84 +- routers/api/v1/repo/release.go | 28 +- routers/api/v1/repo/release_attachment.go | 24 +- routers/api/v1/repo/release_tags.go | 10 +- routers/api/v1/repo/repo.go | 72 +- routers/api/v1/repo/star.go | 6 +- routers/api/v1/repo/status.go | 16 +- routers/api/v1/repo/subscriber.go | 4 +- routers/api/v1/repo/tag.go | 62 +- routers/api/v1/repo/teams.go | 24 +- routers/api/v1/repo/topic.go | 34 +- routers/api/v1/repo/transfer.go | 20 +- routers/api/v1/repo/tree.go | 4 +- routers/api/v1/repo/wiki.go | 36 +- routers/api/v1/shared/project.go | 320 +- routers/api/v1/shared/project_workflow.go | 96 +- routers/api/v1/swagger/repo.go | 7 - routers/api/v1/user/action.go | 38 +- routers/api/v1/user/app.go | 28 +- routers/api/v1/user/block.go | 16 +- routers/api/v1/user/email.go | 10 +- routers/api/v1/user/follower.go | 26 +- routers/api/v1/user/gpg_key.go | 54 +- routers/api/v1/user/key.go | 34 +- routers/api/v1/user/repo.go | 8 +- routers/api/v1/user/runners.go | 18 +- routers/api/v1/user/star.go | 28 +- routers/api/v1/user/user.go | 12 +- routers/api/v1/user/watch.go | 18 +- services/context/api.go | 40 - templates/swagger/v1-openapi3.generated.json | 3362 +++++------------ templates/swagger/v1-swagger.generated.json | 3337 +++++----------- 93 files changed, 2600 insertions(+), 6894 deletions(-) diff --git a/docs/guidelines-backend.md b/docs/guidelines-backend.md index b46f9214ad1..4c6421a838a 100644 --- a/docs/guidelines-backend.md +++ b/docs/guidelines-backend.md @@ -140,8 +140,8 @@ breaking v1. ### Adding and maintaining API routes -- All possible results (errors, success, and failure messages) must be documented in - the swagger comments on the route. +- Document success responses in the swagger comments on the route. Replace explicit + error responses with a `default` response referencing `#/responses/error`. - Every JSON request body must be defined as a struct in `modules/structs/` and registered in [`routers/api/v1/swagger/options.go`](../routers/api/v1/swagger/options.go). - Every JSON response must be defined as a struct in `modules/structs/` and diff --git a/routers/api/v1/admin/action.go b/routers/api/v1/admin/action.go index 38e9cc314ed..12e0d69298e 100644 --- a/routers/api/v1/admin/action.go +++ b/routers/api/v1/admin/action.go @@ -40,12 +40,8 @@ func ListWorkflowJobs(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WorkflowJobsList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" shared.ListJobs(ctx, 0, 0, 0, nil) } @@ -94,10 +90,8 @@ func ListWorkflowRuns(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WorkflowRunsList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" shared.ListRuns(ctx, 0, 0, "") } diff --git a/routers/api/v1/admin/adopt.go b/routers/api/v1/admin/adopt.go index 2bc8ddc4bd6..fec4f3eebd2 100644 --- a/routers/api/v1/admin/adopt.go +++ b/routers/api/v1/admin/adopt.go @@ -38,8 +38,8 @@ func ListUnadoptedRepositories(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/StringSlice" - // "403": - // "$ref": "#/responses/forbidden" + // default: + // "$ref": "#/responses/error" listOptions := utils.GetListOptions(ctx) if listOptions.Page == 0 { @@ -77,10 +77,8 @@ func AdoptRepository(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" - // "403": - // "$ref": "#/responses/forbidden" + // default: + // "$ref": "#/responses/error" ownerName := ctx.PathParam("username") repoName := ctx.PathParam("reponame") @@ -141,8 +139,8 @@ func DeleteUnadoptedRepository(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" + // default: + // "$ref": "#/responses/error" ownerName := ctx.PathParam("username") repoName := ctx.PathParam("reponame") diff --git a/routers/api/v1/admin/cron.go b/routers/api/v1/admin/cron.go index 58c48757644..525a147232d 100644 --- a/routers/api/v1/admin/cron.go +++ b/routers/api/v1/admin/cron.go @@ -33,8 +33,8 @@ func ListCronTasks(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/CronList" - // "403": - // "$ref": "#/responses/forbidden" + // default: + // "$ref": "#/responses/error" tasks := cron.ListTasks() count := len(tasks) @@ -72,8 +72,8 @@ func PostCronTask(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" task := cron.GetTask(ctx.PathParam("task")) if task == nil { ctx.APIErrorNotFound() diff --git a/routers/api/v1/admin/email.go b/routers/api/v1/admin/email.go index 358e350fca4..96d64a303ce 100644 --- a/routers/api/v1/admin/email.go +++ b/routers/api/v1/admin/email.go @@ -32,8 +32,8 @@ func GetAllEmails(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/EmailList" - // "403": - // "$ref": "#/responses/forbidden" + // default: + // "$ref": "#/responses/error" listOptions := utils.GetListOptions(ctx) @@ -79,8 +79,8 @@ func SearchEmail(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/EmailList" - // "403": - // "$ref": "#/responses/forbidden" + // default: + // "$ref": "#/responses/error" ctx.SetPathParam("email", ctx.FormTrim("q")) GetAllEmails(ctx) diff --git a/routers/api/v1/admin/org.go b/routers/api/v1/admin/org.go index 236fb8a30d3..aa8e746fad3 100644 --- a/routers/api/v1/admin/org.go +++ b/routers/api/v1/admin/org.go @@ -41,10 +41,8 @@ func CreateOrg(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Organization" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.CreateOrgOption](ctx) @@ -100,8 +98,8 @@ func GetAllOrgs(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/OrganizationList" - // "403": - // "$ref": "#/responses/forbidden" + // default: + // "$ref": "#/responses/error" listOptions := utils.GetListOptions(ctx) diff --git a/routers/api/v1/admin/packages.go b/routers/api/v1/admin/packages.go index 20f87d2d0c5..247b16056aa 100644 --- a/routers/api/v1/admin/packages.go +++ b/routers/api/v1/admin/packages.go @@ -42,8 +42,8 @@ func ListPackages(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PackageList" - // "403": - // "$ref": "#/responses/forbidden" + // default: + // "$ref": "#/responses/error" listOptions := utils.GetListOptions(ctx) diff --git a/routers/api/v1/admin/repo.go b/routers/api/v1/admin/repo.go index 30d45683a55..3fed82ba484 100644 --- a/routers/api/v1/admin/repo.go +++ b/routers/api/v1/admin/repo.go @@ -32,16 +32,8 @@ func CreateRepo(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Repository" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "409": - // "$ref": "#/responses/error" - // "422": - // "$ref": "#/responses/validationError" form := web.GetForm[*api.CreateRepoOption](ctx) diff --git a/routers/api/v1/admin/runners.go b/routers/api/v1/admin/runners.go index 93af28942c8..92fc6582bbe 100644 --- a/routers/api/v1/admin/runners.go +++ b/routers/api/v1/admin/runners.go @@ -41,10 +41,8 @@ func ListRunners(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/RunnerList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" shared.ListRunners(ctx, 0, 0) } @@ -64,10 +62,8 @@ func GetRunner(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Runner" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" shared.GetRunner(ctx, 0, 0, ctx.PathParamInt64("runner_id")) } @@ -87,10 +83,8 @@ func DeleteRunner(ctx *context.APIContext) { // responses: // "204": // description: runner has been deleted - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" shared.DeleteRunner(ctx, 0, 0, ctx.PathParamInt64("runner_id")) } @@ -116,11 +110,7 @@ func UpdateRunner(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Runner" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" shared.UpdateRunner(ctx, 0, 0, ctx.PathParamInt64("runner_id")) } diff --git a/routers/api/v1/admin/user.go b/routers/api/v1/admin/user.go index 0a09493b983..8205b12f2e8 100644 --- a/routers/api/v1/admin/user.go +++ b/routers/api/v1/admin/user.go @@ -70,14 +70,8 @@ func CreateUser(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/User" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "409": - // "$ref": "#/responses/error" - // "422": - // "$ref": "#/responses/validationError" form := web.GetForm[*api.CreateUserOption](ctx) @@ -179,14 +173,8 @@ func EditUser(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/User" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "409": - // "$ref": "#/responses/error" - // "422": - // "$ref": "#/responses/validationError" form := web.GetForm[*api.EditUserOption](ctx) @@ -282,12 +270,8 @@ func DeleteUser(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" if ctx.ContextUser.IsOrganization() { ctx.APIError(http.StatusUnprocessableEntity, "target is an organization but not user") @@ -338,10 +322,8 @@ func CreatePublicKey(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/PublicKey" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.CreateKeyOption](ctx) @@ -370,10 +352,8 @@ func DeleteUserPublicKey(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if err := asymkey_service.DeletePublicKey(ctx, ctx.ContextUser, ctx.PathParamInt64("id")); err != nil { if asymkey_model.IsErrKeyNotExist(err) { @@ -458,10 +438,8 @@ func SearchUsers(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/UserList" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" listOptions := utils.GetListOptions(ctx) @@ -544,10 +522,8 @@ func RenameUser(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" if ctx.ContextUser.IsOrganization() { ctx.APIError(http.StatusUnprocessableEntity, "target is an organization but not user") diff --git a/routers/api/v1/admin/user_badge.go b/routers/api/v1/admin/user_badge.go index 878b763cdbb..ddbcb37345d 100644 --- a/routers/api/v1/admin/user_badge.go +++ b/routers/api/v1/admin/user_badge.go @@ -28,8 +28,8 @@ func ListUserBadges(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/BadgeList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" badges, maxResults, err := user_model.GetUserBadges(ctx, ctx.ContextUser) if err != nil { @@ -63,8 +63,8 @@ func AddUserBadges(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.UserBadgeOption](ctx) badges := prepareBadgesForReplaceOrAdd(*form) @@ -97,10 +97,8 @@ func DeleteUserBadges(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.UserBadgeOption](ctx) badges := prepareBadgesForReplaceOrAdd(*form) diff --git a/routers/api/v1/misc/gitignore.go b/routers/api/v1/misc/gitignore.go index 6e4800fd588..72b09df78da 100644 --- a/routers/api/v1/misc/gitignore.go +++ b/routers/api/v1/misc/gitignore.go @@ -42,8 +42,8 @@ func GetGitignoreTemplateInfo(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/GitignoreTemplateInfo" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" name := util.PathJoinRelX(ctx.PathParam("name")) text, err := options.Gitignore(name) diff --git a/routers/api/v1/misc/label_templates.go b/routers/api/v1/misc/label_templates.go index 1ddc948b75a..dc2714cd014 100644 --- a/routers/api/v1/misc/label_templates.go +++ b/routers/api/v1/misc/label_templates.go @@ -46,8 +46,8 @@ func GetLabelTemplate(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/LabelTemplateInfo" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" name := util.PathJoinRelX(ctx.PathParam("name")) labels, err := repo_module.LoadTemplateLabelsByDisplayName(name) diff --git a/routers/api/v1/misc/licenses.go b/routers/api/v1/misc/licenses.go index ee3fac131ea..a4bb2ef5995 100644 --- a/routers/api/v1/misc/licenses.go +++ b/routers/api/v1/misc/licenses.go @@ -52,8 +52,8 @@ func GetLicenseTemplateInfo(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/LicenseTemplateInfo" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" name := util.PathJoinRelX(ctx.PathParam("name")) text, err := options.License(name) diff --git a/routers/api/v1/misc/markup.go b/routers/api/v1/misc/markup.go index deef088a4da..48f8d160623 100644 --- a/routers/api/v1/misc/markup.go +++ b/routers/api/v1/misc/markup.go @@ -31,8 +31,8 @@ func Markup(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/MarkupRender" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.MarkupOption](ctx) mode := util.Iif(form.Wiki, "wiki", form.Mode) //nolint:staticcheck // form.Wiki is deprecated @@ -56,8 +56,8 @@ func Markdown(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/MarkdownRender" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.MarkdownOption](ctx) mode := util.Iif(form.Wiki, "wiki", form.Mode) //nolint:staticcheck // form.Wiki is deprecated @@ -83,8 +83,8 @@ func MarkdownRaw(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/MarkdownRender" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" textBytes, _ := io.ReadAll(io.LimitReader(ctx.Req.Body, setting.UI.MaxDisplayFileSize)) common.RenderMarkup(ctx.Base, ctx.Repo, "markdown", util.UnsafeBytesToString(textBytes), "", "") } diff --git a/routers/api/v1/notify/threads.go b/routers/api/v1/notify/threads.go index 7fdf7d7846c..82df2e8b6c9 100644 --- a/routers/api/v1/notify/threads.go +++ b/routers/api/v1/notify/threads.go @@ -33,10 +33,8 @@ func GetThread(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/NotificationThread" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" n := getThread(ctx) if n == nil { @@ -74,10 +72,8 @@ func ReadThread(ctx *context.APIContext) { // responses: // "205": // "$ref": "#/responses/NotificationThread" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" n := getThread(ctx) if n == nil { diff --git a/routers/api/v1/org/action.go b/routers/api/v1/org/action.go index c79830ce0fa..3cc1fe4efe3 100644 --- a/routers/api/v1/org/action.go +++ b/routers/api/v1/org/action.go @@ -45,8 +45,8 @@ func (Action) ListActionsSecrets(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/SecretList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" opts := &secret_model.FindSecretsOptions{ BelongingScope: actions_model.BelongingScopeOwner(ctx.Org.Organization.ID), @@ -102,10 +102,8 @@ func (Action) CreateOrUpdateSecret(ctx *context.APIContext) { // description: response when creating a secret // "204": // description: response when updating a secret - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" opt := web.GetForm[*api.CreateOrUpdateSecretOption](ctx) @@ -151,10 +149,8 @@ func (Action) DeleteSecret(ctx *context.APIContext) { // responses: // "204": // description: delete one secret of the organization - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" s, err := secret_service.DeleteSecretByName(ctx, actions_model.BelongingScopeOwner(ctx.Org.Organization.ID), ctx.PathParam("secretname")) if err != nil { @@ -212,10 +208,8 @@ func (Action) ListVariables(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/VariableList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" listOptions := utils.GetListOptions(ctx) vars, count, err := db.FindAndCount[actions_model.ActionVariable](ctx, &actions_model.FindVariablesOpts{ @@ -263,10 +257,8 @@ func (Action) GetVariable(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ActionVariable" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" v, err := actions_service.GetVariable(ctx, actions_model.FindVariablesOpts{ BelongingScope: actions_model.BelongingScopeOwner(ctx.Org.Organization.ID), @@ -313,10 +305,8 @@ func (Action) DeleteVariable(ctx *context.APIContext) { // description: response when deleting a variable // "204": // description: response when deleting a variable - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" if err := actions_service.DeleteVariableByName(ctx, actions_model.BelongingScopeOwner(ctx.Org.Organization.ID), ctx.PathParam("variablename")); err != nil { ctx.APIErrorAuto(err) @@ -353,11 +343,7 @@ func (Action) CreateVariable(ctx *context.APIContext) { // responses: // "201": // description: successfully created the org-level variable - // "400": - // "$ref": "#/responses/error" - // "409": - // description: variable name already exists. - // "500": + // default: // "$ref": "#/responses/error" opt := web.GetForm[*api.CreateVariableOption](ctx) @@ -415,10 +401,8 @@ func (Action) UpdateVariable(ctx *context.APIContext) { // description: response when updating an org-level variable // "204": // description: response when updating an org-level variable - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" opt := web.GetForm[*api.UpdateVariableOption](ctx) @@ -468,10 +452,8 @@ func (Action) ListRunners(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/RunnerList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" shared.ListRunners(ctx, ctx.Org.Organization.ID, 0) } @@ -496,10 +478,8 @@ func (Action) GetRunner(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Runner" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" shared.GetRunner(ctx, ctx.Org.Organization.ID, 0, ctx.PathParamInt64("runner_id")) } @@ -524,10 +504,8 @@ func (Action) DeleteRunner(ctx *context.APIContext) { // responses: // "204": // description: runner has been deleted - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" shared.DeleteRunner(ctx, ctx.Org.Organization.ID, 0, ctx.PathParamInt64("runner_id")) } @@ -558,12 +536,8 @@ func (Action) UpdateRunner(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Runner" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" shared.UpdateRunner(ctx, ctx.Org.Organization.ID, 0, ctx.PathParamInt64("runner_id")) } @@ -595,10 +569,8 @@ func (Action) ListWorkflowJobs(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WorkflowJobsList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" shared.ListJobs(ctx, ctx.Org.Organization.ID, 0, 0, nil) } @@ -650,10 +622,8 @@ func (Action) ListWorkflowRuns(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WorkflowRunsList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" shared.ListRuns(ctx, ctx.Org.Organization.ID, 0, "") } diff --git a/routers/api/v1/org/avatar.go b/routers/api/v1/org/avatar.go index b6a077df663..220c292c55c 100644 --- a/routers/api/v1/org/avatar.go +++ b/routers/api/v1/org/avatar.go @@ -33,8 +33,8 @@ func UpdateAvatar(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.UpdateUserAvatarOption](ctx) content, err := base64.StdEncoding.DecodeString(form.Image) @@ -68,8 +68,8 @@ func DeleteAvatar(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" err := user_service.DeleteAvatar(ctx, ctx.Org.Organization.AsUser()) if err != nil { ctx.APIErrorInternal(err) diff --git a/routers/api/v1/org/block.go b/routers/api/v1/org/block.go index a43a7b5d7a6..6a32e7e6aae 100644 --- a/routers/api/v1/org/block.go +++ b/routers/api/v1/org/block.go @@ -53,8 +53,8 @@ func CheckUserBlock(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" shared.CheckUserBlock(ctx, ctx.Org.Organization.AsUser()) } @@ -81,10 +81,8 @@ func BlockUser(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" shared.BlockUser(ctx, ctx.Org.Organization.AsUser()) } @@ -107,10 +105,8 @@ func UnblockUser(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" shared.UnblockUser(ctx, ctx.Doer, ctx.Org.Organization.AsUser()) } diff --git a/routers/api/v1/org/hook.go b/routers/api/v1/org/hook.go index cc19781dbc7..86bd970eb3b 100644 --- a/routers/api/v1/org/hook.go +++ b/routers/api/v1/org/hook.go @@ -37,8 +37,8 @@ func ListHooks(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/HookList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" utils.ListOwnerHooks( ctx, @@ -68,8 +68,8 @@ func GetHook(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Hook" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" hook, err := utils.GetOwnerHook(ctx, ctx.ContextUser.ID, ctx.PathParamInt64("id")) if err != nil { @@ -107,8 +107,8 @@ func CreateHook(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Hook" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" utils.AddOwnerHook( ctx, @@ -145,8 +145,8 @@ func EditHook(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Hook" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" utils.EditOwnerHook( ctx, @@ -178,8 +178,8 @@ func DeleteHook(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" utils.DeleteOwnerHook( ctx, diff --git a/routers/api/v1/org/label.go b/routers/api/v1/org/label.go index 0c5c8386996..a2e3629bab0 100644 --- a/routers/api/v1/org/label.go +++ b/routers/api/v1/org/label.go @@ -41,8 +41,8 @@ func ListLabels(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/LabelList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" labels, err := issues_model.GetLabelsByOrgID(ctx, ctx.Org.Organization.ID, ctx.FormString("sort"), utils.GetListOptions(ctx)) if err != nil { @@ -82,10 +82,8 @@ func CreateLabel(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Label" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.CreateLabelOption](ctx) form.Color = strings.Trim(form.Color, " ") color, err := label.NormalizeColor(form.Color) @@ -132,8 +130,8 @@ func GetLabel(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Label" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" var ( label *issues_model.Label @@ -185,10 +183,8 @@ func EditLabel(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Label" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.EditLabelOption](ctx) l, err := issues_model.GetLabelInOrgByID(ctx, ctx.Org.Organization.ID, ctx.PathParamInt64("id")) if err != nil { @@ -246,8 +242,8 @@ func DeleteLabel(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if err := issues_model.DeleteOrgLabel(ctx, ctx.Org.Organization.ID, ctx.PathParamInt64("id")); err != nil { ctx.APIErrorInternal(err) diff --git a/routers/api/v1/org/member.go b/routers/api/v1/org/member.go index 9c66fdad0ed..6f523905fa0 100644 --- a/routers/api/v1/org/member.go +++ b/routers/api/v1/org/member.go @@ -74,8 +74,8 @@ func ListMembers(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/UserList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" var ( isMember bool @@ -116,8 +116,8 @@ func ListPublicMembers(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/UserList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" listMembers(ctx, false) } @@ -143,8 +143,8 @@ func IsMember(ctx *context.APIContext) { // description: user is a member // "303": // description: redirection to /orgs/{org}/public_members/{username} - // "404": - // description: user is not a member + // default: + // "$ref": "#/responses/error" userToCheck := user.GetContextUserByPathParam(ctx) if ctx.Written() { @@ -194,8 +194,8 @@ func IsPublicMember(ctx *context.APIContext) { // responses: // "204": // description: user is a public member - // "404": - // description: user is not a public member + // default: + // "$ref": "#/responses/error" userToCheck := user.GetContextUserByPathParam(ctx) if ctx.Written() { @@ -248,10 +248,8 @@ func PublicizeMember(ctx *context.APIContext) { // responses: // "204": // description: membership publicized - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" userToPublicize := user.GetContextUserByPathParam(ctx) if ctx.Written() { @@ -290,10 +288,8 @@ func ConcealMember(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" userToConceal := user.GetContextUserByPathParam(ctx) if ctx.Written() { @@ -332,8 +328,8 @@ func DeleteMember(ctx *context.APIContext) { // responses: // "204": // description: member removed - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" member := user.GetContextUserByPathParam(ctx) if ctx.Written() { diff --git a/routers/api/v1/org/org.go b/routers/api/v1/org/org.go index 7b17e12773b..9f01428714f 100644 --- a/routers/api/v1/org/org.go +++ b/routers/api/v1/org/org.go @@ -77,8 +77,8 @@ func ListMyOrgs(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/OrganizationList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" listUserOrgs(ctx, ctx.Doer) } @@ -107,8 +107,8 @@ func ListUserOrgs(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/OrganizationList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" listUserOrgs(ctx, ctx.ContextUser) } @@ -134,10 +134,8 @@ func GetUserOrgsPermissions(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/OrganizationPermissions" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" var o *user_model.User if o = user.GetUserByPathParam(ctx, "org"); o == nil { @@ -250,10 +248,8 @@ func Create(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Organization" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.CreateOrgOption](ctx) if !ctx.Doer.CanCreateOrganization() { ctx.APIError(http.StatusForbidden, "not allowed to create org") @@ -310,8 +306,8 @@ func Get(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Organization" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if !organization.HasOrgOrUserVisible(ctx, ctx.Org.Organization.AsUser(), ctx.Doer) { ctx.APIErrorNotFound() @@ -348,10 +344,8 @@ func Rename(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.RenameOrgOption](ctx) orgUser := ctx.Org.Organization.AsUser() @@ -389,8 +383,8 @@ func Edit(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Organization" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.EditOrgOption](ctx) @@ -435,8 +429,8 @@ func Delete(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if err := org.DeleteOrganization(ctx, ctx.Org.Organization, false); err != nil { ctx.APIErrorInternal(err) @@ -473,8 +467,8 @@ func ListOrgActivityFeeds(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ActivityFeedsList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" includePrivate := false if ctx.IsSigned { @@ -554,10 +548,8 @@ func DeleteOrgRepos(ctx *context.APIContext) { // "$ref": "#/responses/empty" // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // Intentionally it only loads repository IDs to avoid loading too much data into memory // There is no need to do pagination here as the number of repositories is expected to be manageable diff --git a/routers/api/v1/org/team.go b/routers/api/v1/org/team.go index 0dcf95003a3..8bd00976f2b 100644 --- a/routers/api/v1/org/team.go +++ b/routers/api/v1/org/team.go @@ -53,8 +53,8 @@ func ListTeams(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/TeamList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" listOptions := utils.GetListOptions(ctx) opts := &organization.SearchTeamOptions{ @@ -140,8 +140,8 @@ func GetTeam(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Team" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" apiTeam, err := convert.ToTeam(ctx, ctx.Org.Team, true) if err != nil { @@ -207,10 +207,8 @@ func CreateTeam(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Team" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.CreateTeamOption](ctx) team := &organization.Team{ OrgID: ctx.Org.Organization.ID, @@ -265,8 +263,8 @@ func EditTeam(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Team" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.EditTeamOption](ctx) team := ctx.Org.Team @@ -336,8 +334,8 @@ func DeleteTeam(ctx *context.APIContext) { // responses: // "204": // description: team deleted - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if err := org_service.DeleteTeam(ctx, ctx.Org.Team); err != nil { ctx.APIErrorInternal(err) @@ -371,8 +369,8 @@ func GetTeamMembers(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/UserList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" listOptions := utils.GetListOptions(ctx) teamMembers, err := organization.GetTeamMembers(ctx, &organization.SearchMembersOptions{ @@ -416,8 +414,8 @@ func GetTeamMember(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/User" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" u := user.GetContextUserByPathParam(ctx) if ctx.Written() { @@ -457,10 +455,8 @@ func AddTeamMember(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" u := user.GetContextUserByPathParam(ctx) if ctx.Written() { @@ -499,8 +495,8 @@ func RemoveTeamMember(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" u := user.GetContextUserByPathParam(ctx) if ctx.Written() { @@ -539,8 +535,8 @@ func GetTeamRepos(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/RepositoryList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" team := ctx.Org.Team listOptions := utils.GetListOptions(ctx) @@ -608,8 +604,8 @@ func GetTeamRepo(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Repository" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" repo, permission := getRepositoryByParams(ctx) if ctx.Written() { @@ -682,10 +678,8 @@ func AddTeamRepository(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" repo, perm := getRepositoryByParams(ctx) if ctx.Written() { @@ -730,10 +724,8 @@ func RemoveTeamRepository(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" repo, perm := getRepositoryByParams(ctx) if ctx.Written() { @@ -790,8 +782,8 @@ func SearchTeam(ctx *context.APIContext) { // type: array // items: // "$ref": "#/definitions/Team" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" listOptions := utils.GetListOptions(ctx) @@ -860,8 +852,8 @@ func ListTeamActivityFeeds(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ActivityFeedsList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" listOptions := utils.GetListOptions(ctx) diff --git a/routers/api/v1/packages/package.go b/routers/api/v1/packages/package.go index d06d2a636b8..15c3a62288b 100644 --- a/routers/api/v1/packages/package.go +++ b/routers/api/v1/packages/package.go @@ -51,8 +51,8 @@ func ListPackages(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PackageList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" listOptions := utils.GetListOptions(ctx) @@ -104,8 +104,8 @@ func GetPackage(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Package" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" apiPackage, err := convert.ToPackage(ctx, ctx.Package.Descriptor, ctx.Doer) if err != nil { @@ -140,8 +140,8 @@ func DeletePackage(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" err := packages_service.RemovePackage(ctx, ctx.Doer, ctx.Package.Descriptor.Package) if err != nil { @@ -180,8 +180,8 @@ func DeletePackageVersion(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" err := packages_service.RemovePackageVersion(ctx, ctx.Doer, ctx.Package.Descriptor.Version) if err != nil { @@ -222,8 +222,8 @@ func ListPackageFiles(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PackageFileList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" apiPackageFiles := make([]*api.PackageFile, 0, len(ctx.Package.Descriptor.Files)) for _, pfd := range ctx.Package.Descriptor.Files { @@ -267,8 +267,8 @@ func ListPackageVersions(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PackageList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" listOptions := utils.GetListOptions(ctx) @@ -315,8 +315,8 @@ func GetLatestPackageVersion(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Package" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" pvs, _, err := packages.SearchLatestVersions(ctx, &packages.PackageSearchOptions{ OwnerID: ctx.Package.Owner.ID, @@ -377,8 +377,8 @@ func LinkPackage(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" pkg, err := packages.GetPackageByName(ctx, ctx.ContextUser.ID, packages.Type(ctx.PathParam("type")), ctx.PathParam("name")) if err != nil { @@ -439,8 +439,8 @@ func UnlinkPackage(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" pkg, err := packages.GetPackageByName(ctx, ctx.ContextUser.ID, packages.Type(ctx.PathParam("type")), ctx.PathParam("name")) if err != nil { diff --git a/routers/api/v1/repo/action.go b/routers/api/v1/repo/action.go index f3a4cc0c471..d8f33437bf7 100644 --- a/routers/api/v1/repo/action.go +++ b/routers/api/v1/repo/action.go @@ -65,8 +65,8 @@ func (Action) ListActionsSecrets(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/SecretList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" repo := ctx.Repo.Repository listOptions := utils.GetListOptions(ctx) @@ -129,10 +129,8 @@ func (Action) CreateOrUpdateSecret(ctx *context.APIContext) { // description: response when creating a secret // "204": // description: response when updating a secret - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" repo := ctx.Repo.Repository @@ -185,10 +183,8 @@ func (Action) DeleteSecret(ctx *context.APIContext) { // responses: // "204": // description: delete one secret of the repository - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" repo := ctx.Repo.Repository @@ -229,10 +225,8 @@ func (Action) GetVariable(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ActionVariable" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" v, err := actions_service.GetVariable(ctx, actions_model.FindVariablesOpts{ BelongingScope: actions_model.BelongingScopeRepo(ctx.Repo.Repository.ID), Name: ctx.PathParam("variablename"), @@ -283,10 +277,8 @@ func (Action) DeleteVariable(ctx *context.APIContext) { // description: response when deleting a variable // "204": // description: response when deleting a variable - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" if err := actions_service.DeleteVariableByName(ctx, actions_model.BelongingScopeRepo(ctx.Repo.Repository.ID), ctx.PathParam("variablename")); err != nil { ctx.APIErrorAuto(err) @@ -326,11 +318,7 @@ func (Action) CreateVariable(ctx *context.APIContext) { // responses: // "201": // description: response when creating a repo-level variable - // "400": - // "$ref": "#/responses/error" - // "409": - // description: variable name already exists. - // "500": + // default: // "$ref": "#/responses/error" opt := web.GetForm[*api.CreateVariableOption](ctx) @@ -391,10 +379,8 @@ func (Action) UpdateVariable(ctx *context.APIContext) { // description: response when updating a repo-level variable // "204": // description: response when updating a repo-level variable - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" opt := web.GetForm[*api.UpdateVariableOption](ctx) @@ -452,10 +438,8 @@ func (Action) ListVariables(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/VariableList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" listOptions := utils.GetListOptions(ctx) @@ -535,10 +519,8 @@ func (Action) ListRunners(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/RunnerList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" shared.ListRunners(ctx, 0, ctx.Repo.Repository.ID) } @@ -568,10 +550,8 @@ func (Action) GetRunner(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Runner" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" shared.GetRunner(ctx, 0, ctx.Repo.Repository.ID, ctx.PathParamInt64("runner_id")) } @@ -601,10 +581,8 @@ func (Action) DeleteRunner(ctx *context.APIContext) { // responses: // "204": // description: runner has been deleted - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" shared.DeleteRunner(ctx, 0, ctx.Repo.Repository.ID, ctx.PathParamInt64("runner_id")) } @@ -640,12 +618,8 @@ func (Action) UpdateRunner(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Runner" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" shared.UpdateRunner(ctx, 0, ctx.Repo.Repository.ID, ctx.PathParamInt64("runner_id")) } @@ -691,12 +665,8 @@ func (Action) ListWorkflowJobs(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WorkflowJobsList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" repoID := ctx.Repo.Repository.ID @@ -762,10 +732,8 @@ func (Action) ListWorkflowRuns(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WorkflowRunsList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" repoID := ctx.Repo.Repository.ID @@ -811,16 +779,8 @@ func ListActionTasks(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/TasksList" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "409": - // "$ref": "#/responses/conflict" - // "422": - // "$ref": "#/responses/validationError" listOptions := utils.GetListOptions(ctx) tasks, total, err := db.FindAndCount[actions_model.ActionTask](ctx, &actions_model.FindTaskOptions{ @@ -876,15 +836,7 @@ func ActionsListRepositoryWorkflows(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ActionWorkflowList" - // "400": - // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" - // "500": + // default: // "$ref": "#/responses/error" workflows, err := convert.ListActionWorkflows(ctx, ctx.Repo.GitRepo, ctx.Repo.Repository) @@ -921,15 +873,7 @@ func ActionsGetWorkflow(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ActionWorkflow" - // "400": - // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" - // "500": + // default: // "$ref": "#/responses/error" workflowID := ctx.PathParam("workflow_id") @@ -1010,12 +954,8 @@ func ActionsListWorkflowRuns(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WorkflowRunsList" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" workflowID := ctx.PathParam("workflow_id") scopedWorkflowSourceRepoID := ctx.FormInt64("scoped_workflow_source_repo_id") @@ -1068,14 +1008,8 @@ func ActionsDisableWorkflow(ctx *context.APIContext) { // responses: // "204": // description: No Content - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" workflowID := ctx.PathParam("workflow_id") err := actions_service.EnableOrDisableWorkflow(ctx, workflowID, false) @@ -1127,14 +1061,8 @@ func ActionsDispatchWorkflow(ctx *context.APIContext) { // "$ref": "#/responses/RunDetails" // "204": // description: No Content, if return_run_details is missing or false - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" workflowID := ctx.PathParam("workflow_id") opt := web.GetForm[*api.CreateActionWorkflowDispatch](ctx) @@ -1215,16 +1143,8 @@ func ActionsEnableWorkflow(ctx *context.APIContext) { // responses: // "204": // description: No Content - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "409": - // "$ref": "#/responses/conflict" - // "422": - // "$ref": "#/responses/validationError" workflowID := ctx.PathParam("workflow_id") err := actions_service.EnableOrDisableWorkflow(ctx, workflowID, true) @@ -1313,10 +1233,8 @@ func GetWorkflowRun(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WorkflowRun" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" run := getCurrentRepoActionRunByID(ctx) if ctx.Written() { @@ -1357,10 +1275,8 @@ func GetWorkflowRunAttempt(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WorkflowRun" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" run, attempt := getCurrentRepoActionRunAttemptByNumber(ctx) if ctx.Written() { @@ -1401,16 +1317,8 @@ func RerunWorkflowRun(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/WorkflowRun" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "409": - // "$ref": "#/responses/error" - // "422": - // "$ref": "#/responses/validationError" run, jobs := getCurrentRepoActionRunJobsByID(ctx) if ctx.Written() { @@ -1454,16 +1362,8 @@ func RerunFailedWorkflowRun(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/empty" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "409": - // "$ref": "#/responses/error" - // "422": - // "$ref": "#/responses/validationError" run, jobs := getCurrentRepoActionRunJobsByID(ctx) if ctx.Written() { @@ -1516,16 +1416,8 @@ func RerunWorkflowJob(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/WorkflowJob" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "409": - // "$ref": "#/responses/error" - // "422": - // "$ref": "#/responses/validationError" run, jobs := getCurrentRepoActionRunJobsByID(ctx) if ctx.Written() { @@ -1616,12 +1508,8 @@ func ListWorkflowRunJobs(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WorkflowJobsList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" repoID, runID := ctx.Repo.Repository.ID, ctx.PathParamInt64("run") @@ -1685,10 +1573,8 @@ func ListWorkflowRunAttemptJobs(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WorkflowJobsList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" run, attempt := getCurrentRepoActionRunAttemptByNumber(ctx) if ctx.Written() { @@ -1724,10 +1610,8 @@ func GetWorkflowJob(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WorkflowJob" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" jobID := ctx.PathParamInt64("job_id") job, has, err := db.GetByID[actions_model.ActionRunJob](ctx, jobID) @@ -1780,10 +1664,8 @@ func GetArtifactsOfRun(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ArtifactsList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" artifactName := ctx.Req.URL.Query().Get("name") repoID, runID := ctx.Repo.Repository.ID, ctx.PathParamInt64("run") @@ -1837,10 +1719,8 @@ func DeleteActionRun(ctx *context.APIContext) { // responses: // "204": // description: "No Content" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" run := getCurrentRepoActionRunByID(ctx) if ctx.Written() { @@ -1885,10 +1765,8 @@ func GetArtifacts(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ArtifactsList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" repoID := ctx.Repo.Repository.ID artifactName := ctx.Req.URL.Query().Get("name") @@ -1941,10 +1819,8 @@ func GetArtifact(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Artifact" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" art := getArtifactByPathParam(ctx, ctx.Repo.Repository) if ctx.Written() { @@ -1985,10 +1861,8 @@ func DeleteArtifact(ctx *context.APIContext) { // responses: // "204": // description: "No Content" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" art := getArtifactByPathParam(ctx, ctx.Repo.Repository) if ctx.Written() { @@ -2048,10 +1922,8 @@ func DownloadArtifact(ctx *context.APIContext) { // responses: // "302": // description: redirect to the blob download - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" art := getArtifactByPathParam(ctx, ctx.Repo.Repository) if ctx.Written() { diff --git a/routers/api/v1/repo/actions_run.go b/routers/api/v1/repo/actions_run.go index 90c14d03a1d..34ac387b0b8 100644 --- a/routers/api/v1/repo/actions_run.go +++ b/routers/api/v1/repo/actions_run.go @@ -37,10 +37,8 @@ func DownloadActionsRunJobLogs(ctx *context.APIContext) { // responses: // "200": // description: output blob content - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" jobID := ctx.PathParamInt64("job_id") curJob, err := actions_model.GetRunJobByRepoAndID(ctx, ctx.Repo.Repository.ID, jobID) @@ -79,14 +77,8 @@ func CancelWorkflowRun(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WorkflowRun" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "409": - // "$ref": "#/responses/conflict" cancelWorkflowRun(ctx, false) } @@ -120,14 +112,8 @@ func ForceCancelWorkflowRun(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WorkflowRun" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "409": - // "$ref": "#/responses/conflict" cancelWorkflowRun(ctx, true) } @@ -182,14 +168,8 @@ func ApproveWorkflowRun(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WorkflowRun" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "409": - // "$ref": "#/responses/conflict" run := getCurrentRepoActionRunByID(ctx) if ctx.Written() { @@ -240,8 +220,8 @@ func GetWorkflowRunLogs(ctx *context.APIContext) { // responses: // "200": // description: Logs archive - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" run := getCurrentRepoActionRunByID(ctx) if ctx.Written() { diff --git a/routers/api/v1/repo/avatar.go b/routers/api/v1/repo/avatar.go index 8a17f2ef2e4..da8088974dd 100644 --- a/routers/api/v1/repo/avatar.go +++ b/routers/api/v1/repo/avatar.go @@ -38,8 +38,8 @@ func UpdateAvatar(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.UpdateRepoAvatarOption](ctx) content, err := base64.StdEncoding.DecodeString(form.Image) @@ -77,8 +77,8 @@ func DeleteAvatar(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" err := repo_service.DeleteAvatar(ctx, ctx.Repo.Repository) if err != nil { ctx.APIErrorInternal(err) diff --git a/routers/api/v1/repo/blob.go b/routers/api/v1/repo/blob.go index d16cff07657..7c3062592a6 100644 --- a/routers/api/v1/repo/blob.go +++ b/routers/api/v1/repo/blob.go @@ -36,10 +36,8 @@ func GetBlob(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/GitBlobResponse" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" sha := ctx.PathParam("sha") if len(sha) == 0 { diff --git a/routers/api/v1/repo/branch.go b/routers/api/v1/repo/branch.go index 619fb210e0b..45ead66b306 100644 --- a/routers/api/v1/repo/branch.go +++ b/routers/api/v1/repo/branch.go @@ -54,8 +54,8 @@ func GetBranch(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Branch" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" branchName := ctx.PathParam("*") @@ -115,12 +115,8 @@ func DeleteBranch(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" if ctx.Repo.Repository.IsEmpty { ctx.APIError(http.StatusNotFound, "Git Repository is empty.") return @@ -194,14 +190,8 @@ func CreateBranch(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Branch" - // "403": - // description: The branch is archived or a mirror. - // "404": - // description: The old branch does not exist. - // "409": - // description: The branch with the same name already exists. - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" if ctx.Repo.Repository.IsEmpty { ctx.APIError(http.StatusNotFound, "Git Repository is empty.") @@ -418,14 +408,8 @@ func UpdateBranch(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "409": - // "$ref": "#/responses/conflict" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" opt := web.GetForm[*api.UpdateBranchRepoOption](ctx) @@ -493,12 +477,8 @@ func RenameBranch(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" opt := web.GetForm[*api.RenameBranchRepoOption](ctx) @@ -565,8 +545,8 @@ func GetBranchProtection(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/BranchProtection" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" repo := ctx.Repo.Repository bpName := ctx.PathParam("*") @@ -674,14 +654,8 @@ func CreateBranchProtection(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/BranchProtection" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.CreateBranchProtectionOption](ctx) repo := ctx.Repo.Repository @@ -882,12 +856,8 @@ func EditBranchProtection(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/BranchProtection" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.EditBranchProtectionOption](ctx) repo := ctx.Repo.Repository bpName := ctx.PathParam("*") @@ -1231,8 +1201,8 @@ func DeleteBranchProtection(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" repo := ctx.Repo.Repository bpName := ctx.PathParam("*") @@ -1281,12 +1251,8 @@ func UpdateBranchProtectionPriories(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.UpdateBranchProtectionPriories](ctx) repo := ctx.Repo.Repository @@ -1322,11 +1288,7 @@ func MergeUpstream(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/MergeUpstreamResponse" - // "400": - // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" - // "409": + // default: // "$ref": "#/responses/error" form := web.GetForm[*api.MergeUpstreamRequest](ctx) mergeStyle, err := repo_service.MergeUpstream(ctx, ctx.Doer, ctx.Repo.Repository, form.Branch, form.FfOnly) diff --git a/routers/api/v1/repo/collaborators.go b/routers/api/v1/repo/collaborators.go index bf74299f3d5..0e7f2ef2632 100644 --- a/routers/api/v1/repo/collaborators.go +++ b/routers/api/v1/repo/collaborators.go @@ -52,8 +52,8 @@ func ListCollaborators(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/UserList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" collaborators, total, err := repo_model.GetCollaborators(ctx, &repo_model.FindCollaborationOptions{ ListOptions: utils.GetListOptions(ctx), @@ -99,10 +99,8 @@ func IsCollaborator(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" user, err := user_model.GetUserByName(ctx, ctx.PathParam("collaborator")) if err != nil { @@ -155,12 +153,8 @@ func AddOrUpdateCollaborator(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.AddCollaboratorOption](ctx) @@ -222,10 +216,8 @@ func DeleteCollaborator(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" collaborator, err := user_model.GetUserByName(ctx, ctx.PathParam("collaborator")) if err != nil { @@ -270,10 +262,8 @@ func GetRepoPermissions(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/RepoCollaboratorPermission" - // "404": - // "$ref": "#/responses/notFound" - // "403": - // "$ref": "#/responses/forbidden" + // default: + // "$ref": "#/responses/error" collaboratorUsername := ctx.PathParam("collaborator") if !ctx.Doer.IsAdmin && !strings.EqualFold(ctx.Doer.LowerName, collaboratorUsername) && !ctx.IsUserRepoAdmin() { @@ -321,8 +311,8 @@ func GetReviewers(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/UserList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" canChooseReviewer := issue_service.CanDoerChangeReviewRequests(ctx, ctx.Doer, ctx.Repo.Repository, 0) if !canChooseReviewer { @@ -359,8 +349,8 @@ func GetAssignees(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/UserList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" assignees, err := repo_model.GetRepoAssignees(ctx, ctx.Repo.Repository) if err != nil { @@ -397,10 +387,8 @@ func CheckRepoIssueAssignee(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" if checkAssignableUser(ctx, ctx.PathParam("assignee"), ctx.Repo.Repository) { ctx.Status(http.StatusNoContent) diff --git a/routers/api/v1/repo/commits.go b/routers/api/v1/repo/commits.go index 25effda94f1..30a13295377 100644 --- a/routers/api/v1/repo/commits.go +++ b/routers/api/v1/repo/commits.go @@ -58,10 +58,8 @@ func GetSingleCommit(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Commit" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" sha := ctx.PathParam("sha") if !git.IsValidRefPattern(sha) { @@ -154,10 +152,8 @@ func GetAllCommits(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/CommitList" - // "404": - // "$ref": "#/responses/notFound" - // "409": - // "$ref": "#/responses/EmptyRepository" + // default: + // "$ref": "#/responses/error" since := ctx.FormString("since") until := ctx.FormString("until") @@ -354,8 +350,8 @@ func DownloadCommitDiffOrPatch(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/string" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" sha := ctx.PathParam("sha") diffType := git.RawDiffType(ctx.PathParam("diffType")) @@ -395,8 +391,8 @@ func GetCommitPullRequest(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PullRequest" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" pr, err := issues_model.GetPullRequestByMergedCommit(ctx, ctx.Repo.Repository.ID, ctx.PathParam("sha")) if err != nil { diff --git a/routers/api/v1/repo/compare.go b/routers/api/v1/repo/compare.go index 05573603052..f5b1a9b54f7 100644 --- a/routers/api/v1/repo/compare.go +++ b/routers/api/v1/repo/compare.go @@ -59,10 +59,8 @@ func CompareDiff(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Compare" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" if ctx.Repo.GitRepo == nil { var err error diff --git a/routers/api/v1/repo/file.go b/routers/api/v1/repo/file.go index 6a97b5dc591..75ea20ca06b 100644 --- a/routers/api/v1/repo/file.go +++ b/routers/api/v1/repo/file.go @@ -67,8 +67,8 @@ func GetRawFile(ctx *context.APIContext) { // description: Returns raw file content. // schema: // type: file - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if ctx.Repo.Repository.IsEmpty { ctx.APIErrorNotFound() @@ -120,8 +120,8 @@ func GetRawFileOrLFS(ctx *context.APIContext) { // description: Returns raw file content. // schema: // type: file - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if ctx.Repo.Repository.IsEmpty { ctx.APIErrorNotFound() @@ -260,8 +260,8 @@ func GetArchive(ctx *context.APIContext) { // responses: // 200: // description: success - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" serveRepoArchive(ctx, ctx.PathParam("*"), ctx.FormStrings("path")) } @@ -296,8 +296,8 @@ func GetEditorconfig(ctx *context.APIContext) { // responses: // 200: // description: success - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" ec, _, err := ctx.Repo.GetEditorconfig(ctx) if err != nil { @@ -391,14 +391,8 @@ func ChangeFiles(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/FilesResponse" - // "403": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/error" - // "423": - // "$ref": "#/responses/repoArchivedError" apiOpts, opts := getAPIChangeRepoFileOptions[*api.ChangeFilesOptions](ctx) if ctx.Written() { return @@ -465,14 +459,8 @@ func CreateFile(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/FileResponse" - // "403": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/error" - // "423": - // "$ref": "#/responses/repoArchivedError" apiOpts, opts := getAPIChangeRepoFileOptions[*api.CreateFileOptions](ctx) if ctx.Written() { @@ -536,14 +524,8 @@ func UpdateFile(ctx *context.APIContext) { // "$ref": "#/responses/FileResponse" // "201": // "$ref": "#/responses/FileResponse" - // "403": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/error" - // "423": - // "$ref": "#/responses/repoArchivedError" apiOpts, opts := getAPIChangeRepoFileOptions[*api.UpdateFileOptions](ctx) if ctx.Written() { @@ -659,16 +641,8 @@ func DeleteFile(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/FileDeleteResponse" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/error" - // "422": - // "$ref": "#/responses/error" - // "423": - // "$ref": "#/responses/repoArchivedError" apiOpts, opts := getAPIChangeRepoFileOptions[*api.DeleteFileOptions](ctx) if ctx.Written() { @@ -743,8 +717,8 @@ func GetContentsExt(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ContentsExtResponse" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if treePath := ctx.PathParam("*"); treePath == "." || treePath == "/" { ctx.SetPathParam("*", "") // workaround for swagger, it requires path parameter to be "required", but we need to list root directory @@ -802,8 +776,8 @@ func GetContents(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ContentsResponse" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" ret := getRepoContents(ctx, files_service.GetContentsOrListOptions{ TreePath: ctx.PathParam("*"), IncludeSingleFileContent: true, @@ -854,8 +828,8 @@ func GetContentsList(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ContentsListResponse" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // same as GetContents(), this function is here because swagger fails if path is empty in GetContents() interface GetContents(ctx) @@ -892,8 +866,8 @@ func GetFileContentsGet(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ContentsListResponse" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // The POST method requires "write" permission, so we also support this "GET" method opts := &api.GetFilesOptions{} @@ -939,8 +913,8 @@ func GetFileContentsPost(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ContentsListResponse" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // This is actually a "read" request, but we need to accept a "files" list, then POST method seems easy to use. // But the permission system requires that the caller must have "write" permission to use POST method. diff --git a/routers/api/v1/repo/fork.go b/routers/api/v1/repo/fork.go index 4749c2fd6d6..cab8aef1957 100644 --- a/routers/api/v1/repo/fork.go +++ b/routers/api/v1/repo/fork.go @@ -51,8 +51,8 @@ func ListForks(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/RepositoryList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" listOptions := utils.GetListOptions(ctx) forks, total, err := repo_service.FindForks(ctx, ctx.Repo.Repository, ctx.Doer, listOptions) @@ -138,14 +138,8 @@ func CreateFork(ctx *context.APIContext) { // responses: // "202": // "$ref": "#/responses/Repository" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "409": - // description: The repository with the same name already exists. - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.CreateForkOption](ctx) forkOwner := ctx.Doer // user/org that will own the fork diff --git a/routers/api/v1/repo/git_hook.go b/routers/api/v1/repo/git_hook.go index eb1bffcc207..4b55a9b55ab 100644 --- a/routers/api/v1/repo/git_hook.go +++ b/routers/api/v1/repo/git_hook.go @@ -35,8 +35,8 @@ func ListGitHooks(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/GitHookList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" hooks, err := git.ListHooks(ctx.Repo.GitRepo) if err != nil { @@ -77,8 +77,8 @@ func GetGitHook(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/GitHook" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" hookID := ctx.PathParam("id") hook, err := git.GetHook(ctx.Repo.GitRepo, hookID) @@ -123,8 +123,8 @@ func EditGitHook(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/GitHook" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.EditGitHookOption](ctx) hookID := ctx.PathParam("id") @@ -173,8 +173,8 @@ func DeleteGitHook(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" hookID := ctx.PathParam("id") hook, err := git.GetHook(ctx.Repo.GitRepo, hookID) diff --git a/routers/api/v1/repo/git_ref.go b/routers/api/v1/repo/git_ref.go index c6014e73118..e48d7e1109d 100644 --- a/routers/api/v1/repo/git_ref.go +++ b/routers/api/v1/repo/git_ref.go @@ -36,8 +36,8 @@ func GetGitAllRefs(ctx *context.APIContext) { // "200": // # "$ref": "#/responses/Reference" TODO: swagger doesn't support different output formats by ref // "$ref": "#/responses/ReferenceList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" getGitRefsInternal(ctx, "") } @@ -69,8 +69,8 @@ func GetGitRefs(ctx *context.APIContext) { // "200": // # "$ref": "#/responses/Reference" TODO: swagger doesn't support different output formats by ref // "$ref": "#/responses/ReferenceList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" getGitRefsInternal(ctx, ctx.PathParam("*")) } diff --git a/routers/api/v1/repo/hook.go b/routers/api/v1/repo/hook.go index 3796d61aed0..af757d0fd0e 100644 --- a/routers/api/v1/repo/hook.go +++ b/routers/api/v1/repo/hook.go @@ -51,8 +51,8 @@ func ListHooks(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/HookList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" opts := &webhook.ListWebhookOptions{ ListOptions: utils.GetListOptions(ctx), @@ -105,8 +105,8 @@ func GetHook(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Hook" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" repo := ctx.Repo hookID := ctx.PathParamInt64("id") @@ -156,8 +156,8 @@ func ListDeliveries(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/HookDeliveryList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" hookID := ctx.PathParamInt64("id") if _, err := utils.GetRepoHook(ctx, ctx.Repo.Repository.ID, hookID); err != nil { @@ -224,8 +224,8 @@ func GetDelivery(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/HookDelivery" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" hookID := ctx.PathParamInt64("id") if _, err := utils.GetRepoHook(ctx, ctx.Repo.Repository.ID, hookID); err != nil { @@ -276,8 +276,8 @@ func TestHook(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if ctx.Repo.Commit == nil { // if repo does not have any commits, then don't send a webhook @@ -345,8 +345,8 @@ func CreateHook(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Hook" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" utils.AddRepoHook(ctx, web.GetForm[*api.CreateHookOption](ctx)) } @@ -382,8 +382,8 @@ func EditHook(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Hook" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.EditHookOption](ctx) hookID := ctx.PathParamInt64("id") utils.EditRepoHook(ctx, form, hookID) @@ -416,8 +416,8 @@ func DeleteHook(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if err := webhook.DeleteWebhookByRepoID(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64("id")); err != nil { if webhook.IsErrWebhookNotExist(err) { ctx.APIErrorNotFound() diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go index 035d40cf8b9..705bc1b751d 100644 --- a/routers/api/v1/repo/issue.go +++ b/routers/api/v1/repo/issue.go @@ -122,10 +122,8 @@ func SearchIssues(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/IssueList" - // "400": + // default: // "$ref": "#/responses/error" - // "422": - // "$ref": "#/responses/validationError" before, since, err := context.GetQueryBeforeSince(ctx.Base) if err != nil { @@ -322,8 +320,8 @@ func ListIssues(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/IssueList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" before, since, err := context.GetQueryBeforeSince(ctx.Base) if err != nil { ctx.APIError(http.StatusUnprocessableEntity, err.Error()) @@ -507,8 +505,8 @@ func GetIssue(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Issue" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) if issue == nil { @@ -581,16 +579,8 @@ func CreateIssue(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Issue" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "412": + // default: // "$ref": "#/responses/error" - // "422": - // "$ref": "#/responses/validationError" - // "423": - // "$ref": "#/responses/repoArchivedError" form := web.GetForm[*api.CreateIssueOption](ctx) issue := &issues_model.Issue{ @@ -689,14 +679,8 @@ func EditIssue(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Issue" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "412": + // default: // "$ref": "#/responses/error" - // "423": - // "$ref": "#/responses/repoArchivedError" form := web.GetForm[*api.EditIssueOption](ctx) issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) @@ -872,12 +856,8 @@ func DeleteIssue(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) if issue == nil { return @@ -941,10 +921,8 @@ func UpdateIssueDeadline(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/IssueDeadline" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.EditDeadlineOption](ctx) issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) if issue == nil { diff --git a/routers/api/v1/repo/issue_assignee.go b/routers/api/v1/repo/issue_assignee.go index eee47dd190b..2fe242fbbdc 100644 --- a/routers/api/v1/repo/issue_assignee.go +++ b/routers/api/v1/repo/issue_assignee.go @@ -53,14 +53,8 @@ func AddIssueAssignees(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Issue" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" opts := web.GetForm[*api.IssueAssigneesOption](ctx) updateIssueAssignees(ctx, *opts, true) @@ -100,12 +94,8 @@ func DeleteIssueAssignees(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Issue" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" opts := web.GetForm[*api.IssueAssigneesOption](ctx) updateIssueAssignees(ctx, *opts, false) @@ -143,10 +133,8 @@ func CheckIssueAssignee(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) if issue == nil { diff --git a/routers/api/v1/repo/issue_attachment.go b/routers/api/v1/repo/issue_attachment.go index 3bb3ac99a4e..37ac66f90a0 100644 --- a/routers/api/v1/repo/issue_attachment.go +++ b/routers/api/v1/repo/issue_attachment.go @@ -54,7 +54,7 @@ func GetIssueAttachment(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Attachment" - // "404": + // default: // "$ref": "#/responses/error" issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) @@ -97,7 +97,7 @@ func ListIssueAttachments(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/AttachmentList" - // "404": + // default: // "$ref": "#/responses/error" issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) @@ -152,16 +152,8 @@ func CreateIssueAttachment(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Attachment" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/error" - // "413": - // "$ref": "#/responses/error" - // "422": - // "$ref": "#/responses/validationError" - // "423": - // "$ref": "#/responses/repoArchivedError" issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) if issue == nil { @@ -252,12 +244,8 @@ func EditIssueAttachment(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Attachment" - // "404": + // default: // "$ref": "#/responses/error" - // "422": - // "$ref": "#/responses/validationError" - // "423": - // "$ref": "#/responses/repoArchivedError" attachment := getIssueAttachmentSafeWrite(ctx) if attachment == nil { @@ -315,10 +303,8 @@ func DeleteIssueAttachment(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": + // default: // "$ref": "#/responses/error" - // "423": - // "$ref": "#/responses/repoArchivedError" attachment := getIssueAttachmentSafeWrite(ctx) if attachment == nil { diff --git a/routers/api/v1/repo/issue_comment.go b/routers/api/v1/repo/issue_comment.go index eb98ee43f56..65599005e5f 100644 --- a/routers/api/v1/repo/issue_comment.go +++ b/routers/api/v1/repo/issue_comment.go @@ -58,8 +58,8 @@ func ListIssueComments(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/CommentList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" before, since, err := context.GetQueryBeforeSince(ctx.Base) if err != nil { @@ -155,8 +155,8 @@ func ListIssueCommentsAndTimeline(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/TimelineList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" before, since, err := context.GetQueryBeforeSince(ctx.Base) if err != nil { @@ -242,8 +242,8 @@ func ListRepoIssueComments(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/CommentList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" before, since, err := context.GetQueryBeforeSince(ctx.Base) if err != nil { @@ -345,12 +345,8 @@ func CreateIssueComment(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Comment" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.CreateIssueCommentOption](ctx) issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) @@ -407,10 +403,8 @@ func GetIssueComment(ctx *context.APIContext) { // "$ref": "#/responses/Comment" // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" comment, err := issues_model.GetCommentWithRepoID(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64("id")) if err != nil { @@ -471,12 +465,8 @@ func EditIssueComment(ctx *context.APIContext) { // "$ref": "#/responses/Comment" // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.EditIssueCommentOption](ctx) editIssueComment(ctx, *form) @@ -523,10 +513,8 @@ func EditIssueCommentDeprecated(ctx *context.APIContext) { // "$ref": "#/responses/Comment" // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.EditIssueCommentOption](ctx) editIssueComment(ctx, *form) @@ -589,10 +577,8 @@ func DeleteIssueComment(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" deleteIssueComment(ctx) } @@ -628,10 +614,8 @@ func DeleteIssueCommentDeprecated(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" deleteIssueComment(ctx) } diff --git a/routers/api/v1/repo/issue_comment_attachment.go b/routers/api/v1/repo/issue_comment_attachment.go index 9eea903bf36..cb718a51aaf 100644 --- a/routers/api/v1/repo/issue_comment_attachment.go +++ b/routers/api/v1/repo/issue_comment_attachment.go @@ -56,7 +56,7 @@ func GetIssueCommentAttachment(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Attachment" - // "404": + // default: // "$ref": "#/responses/error" comment := getIssueCommentSafe(ctx) @@ -103,7 +103,7 @@ func ListIssueCommentAttachments(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/AttachmentList" - // "404": + // default: // "$ref": "#/responses/error" comment := getIssueCommentSafe(ctx) if comment == nil { @@ -157,18 +157,8 @@ func CreateIssueCommentAttachment(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Attachment" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/error" - // "413": - // "$ref": "#/responses/error" - // "422": - // "$ref": "#/responses/validationError" - // "423": - // "$ref": "#/responses/repoArchivedError" // Check if comment exists and load comment comment := getIssueCommentSafe(ctx) @@ -268,12 +258,8 @@ func EditIssueCommentAttachment(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Attachment" - // "404": + // default: // "$ref": "#/responses/error" - // "422": - // "$ref": "#/responses/validationError" - // "423": - // "$ref": "#/responses/repoArchivedError" attach := getIssueCommentAttachmentSafeWrite(ctx) if attach == nil { return @@ -328,10 +314,8 @@ func DeleteIssueCommentAttachment(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": + // default: // "$ref": "#/responses/error" - // "423": - // "$ref": "#/responses/repoArchivedError" attach := getIssueCommentAttachmentSafeWrite(ctx) if attach == nil { return diff --git a/routers/api/v1/repo/issue_dependency.go b/routers/api/v1/repo/issue_dependency.go index c7a23d01d4a..972e946a481 100644 --- a/routers/api/v1/repo/issue_dependency.go +++ b/routers/api/v1/repo/issue_dependency.go @@ -52,8 +52,8 @@ func GetIssueDependencies(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/IssueList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // If this issue's repository does not enable dependencies then there can be no dependencies by default if !ctx.Repo.Repository.IsDependenciesEnabled(ctx) { @@ -164,10 +164,8 @@ func CreateIssueDependency(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Issue" - // "404": - // description: the issue does not exist - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" // We want to make <:index> depend on
, i.e. <:index> is the target target := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) @@ -225,10 +223,8 @@ func RemoveIssueDependency(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Issue" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" // We want to make <:index> depend on , i.e. <:index> is the target target := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) @@ -290,8 +286,8 @@ func GetIssueBlocks(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/IssueList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // We need to list the issues that DEPEND on this issue not the other way round // Therefore whether dependencies are enabled or not in this repository is potentially irrelevant. @@ -384,8 +380,8 @@ func CreateIssueBlocking(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Issue" - // "404": - // description: the issue does not exist + // default: + // "$ref": "#/responses/error" dependency := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) if ctx.Written() { @@ -441,8 +437,8 @@ func RemoveIssueBlocking(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Issue" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" dependency := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) if ctx.Written() { diff --git a/routers/api/v1/repo/issue_label.go b/routers/api/v1/repo/issue_label.go index a1f285a91b0..3505696dd7d 100644 --- a/routers/api/v1/repo/issue_label.go +++ b/routers/api/v1/repo/issue_label.go @@ -45,8 +45,8 @@ func ListIssueLabels(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/LabelList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) if issue == nil { @@ -94,12 +94,8 @@ func AddIssueLabels(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/LabelList" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.IssueLabelsOption](ctx) issue, labels, err := prepareForReplaceOrAdd(ctx, *form) @@ -154,14 +150,8 @@ func DeleteIssueLabel(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) if issue == nil { @@ -223,12 +213,8 @@ func ReplaceIssueLabels(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/LabelList" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.IssueLabelsOption](ctx) issue, labels, err := prepareForReplaceOrAdd(ctx, *form) if err != nil { @@ -276,12 +262,8 @@ func ClearIssueLabels(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) if issue == nil { diff --git a/routers/api/v1/repo/issue_lock.go b/routers/api/v1/repo/issue_lock.go index f0ac1847b08..f10d199f9e7 100644 --- a/routers/api/v1/repo/issue_lock.go +++ b/routers/api/v1/repo/issue_lock.go @@ -45,10 +45,8 @@ func LockIssue(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" reason := web.GetForm[*api.LockIssueOption](ctx).Reason issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) @@ -108,10 +106,8 @@ func UnlockIssue(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) if issue == nil { diff --git a/routers/api/v1/repo/issue_pin.go b/routers/api/v1/repo/issue_pin.go index 1570f9f8ddb..557ace78458 100644 --- a/routers/api/v1/repo/issue_pin.go +++ b/routers/api/v1/repo/issue_pin.go @@ -37,10 +37,8 @@ func PinIssue(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) if issue == nil { return @@ -87,10 +85,8 @@ func UnpinIssue(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) if issue == nil { return @@ -143,10 +139,8 @@ func MoveIssuePin(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) if issue == nil { return @@ -182,8 +176,8 @@ func ListPinnedIssues(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/IssueList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" issues, err := issues_model.GetPinnedIssues(ctx, ctx.Repo.Repository.ID, false) if err != nil { ctx.APIErrorInternal(err) @@ -214,8 +208,8 @@ func ListPinnedPullRequests(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PullRequestList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" issues, err := issues_model.GetPinnedIssues(ctx, ctx.Repo.Repository.ID, true) if err != nil { ctx.APIErrorInternal(err) @@ -271,8 +265,8 @@ func AreNewIssuePinsAllowed(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/RepoNewIssuePinsAllowed" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" pinsAllowed := api.NewIssuePinsAllowed{} var err error diff --git a/routers/api/v1/repo/issue_reaction.go b/routers/api/v1/repo/issue_reaction.go index 66252b72a79..3a9983f7d29 100644 --- a/routers/api/v1/repo/issue_reaction.go +++ b/routers/api/v1/repo/issue_reaction.go @@ -47,10 +47,8 @@ func GetIssueCommentReactions(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ReactionList" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" comment, err := issues_model.GetCommentByID(ctx, ctx.PathParamInt64("id")) if err != nil { @@ -131,10 +129,8 @@ func PostIssueCommentReaction(ctx *context.APIContext) { // "$ref": "#/responses/Reaction" // "201": // "$ref": "#/responses/Reaction" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.EditReactionOption](ctx) @@ -174,10 +170,8 @@ func DeleteIssueCommentReaction(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.EditReactionOption](ctx) @@ -266,10 +260,8 @@ func GetIssueReactions(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ReactionList" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" issue, err := issues_model.GetIssueWithAttrsByIndex(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64("index")) if err != nil { @@ -345,10 +337,8 @@ func PostIssueReaction(ctx *context.APIContext) { // "$ref": "#/responses/Reaction" // "201": // "$ref": "#/responses/Reaction" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.EditReactionOption](ctx) changeIssueReaction(ctx, *form, true) } @@ -386,10 +376,8 @@ func DeleteIssueReaction(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.EditReactionOption](ctx) changeIssueReaction(ctx, *form, false) } diff --git a/routers/api/v1/repo/issue_stopwatch.go b/routers/api/v1/repo/issue_stopwatch.go index 92c05a03446..4fb4562260c 100644 --- a/routers/api/v1/repo/issue_stopwatch.go +++ b/routers/api/v1/repo/issue_stopwatch.go @@ -42,12 +42,8 @@ func StartIssueStopwatch(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/empty" - // "403": - // description: Not repo writer, user does not have rights to toggle stopwatch - // "404": - // "$ref": "#/responses/notFound" - // "409": - // description: Cannot start a stopwatch again if it already exists + // default: + // "$ref": "#/responses/error" issue := prepareIssueForStopwatch(ctx) if ctx.Written() { @@ -95,12 +91,8 @@ func StopIssueStopwatch(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/empty" - // "403": - // description: Not repo writer, user does not have rights to toggle stopwatch - // "404": - // "$ref": "#/responses/notFound" - // "409": - // description: Cannot stop a non-existent stopwatch + // default: + // "$ref": "#/responses/error" issue := prepareIssueForStopwatch(ctx) if ctx.Written() { @@ -147,12 +139,8 @@ func DeleteIssueStopwatch(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // description: Not repo writer, user does not have rights to toggle stopwatch - // "404": - // "$ref": "#/responses/notFound" - // "409": - // description: Cannot cancel a non-existent stopwatch + // default: + // "$ref": "#/responses/error" issue := prepareIssueForStopwatch(ctx) if ctx.Written() { diff --git a/routers/api/v1/repo/issue_subscription.go b/routers/api/v1/repo/issue_subscription.go index ed66443740f..5c943044e3f 100644 --- a/routers/api/v1/repo/issue_subscription.go +++ b/routers/api/v1/repo/issue_subscription.go @@ -53,8 +53,8 @@ func AddIssueSubscription(ctx *context.APIContext) { // description: Successfully Subscribed // "304": // description: User can only subscribe itself if he is no admin - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" setIssueSubscription(ctx, true) } @@ -97,8 +97,8 @@ func DelIssueSubscription(ctx *context.APIContext) { // description: Successfully Unsubscribed // "304": // description: User can only subscribe itself if he is no admin - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" setIssueSubscription(ctx, false) } @@ -176,8 +176,8 @@ func CheckIssueSubscription(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WatchInfo" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) if issue == nil { @@ -236,8 +236,8 @@ func GetIssueSubscribers(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/UserList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) if issue == nil { diff --git a/routers/api/v1/repo/issue_tracked_time.go b/routers/api/v1/repo/issue_tracked_time.go index fa28662662c..ed12da7fda5 100644 --- a/routers/api/v1/repo/issue_tracked_time.go +++ b/routers/api/v1/repo/issue_tracked_time.go @@ -68,8 +68,8 @@ func ListTrackedTimes(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/TrackedTimeList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if !ctx.Repo.Repository.IsTimetrackerEnabled(ctx) { ctx.APIErrorNotFound("timetracker is disabled") @@ -193,12 +193,8 @@ func AddTime(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/TrackedTime" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" form := web.GetForm[*api.AddTimeOption](ctx) issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) if issue == nil { @@ -273,12 +269,8 @@ func ResetIssueTime(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) if issue == nil { @@ -341,12 +333,8 @@ func DeleteTime(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" issue := getRepoIssueByIndexForDoer(ctx, ctx.PathParamInt64("index")) if issue == nil { @@ -413,12 +401,8 @@ func ListTrackedTimesByUser(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/TrackedTimeList" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" if !ctx.Repo.Repository.IsTimetrackerEnabled(ctx) { ctx.APIError(http.StatusBadRequest, "time tracking disabled") @@ -499,12 +483,8 @@ func ListTrackedTimesByRepository(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/TrackedTimeList" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" if !ctx.Repo.Repository.IsTimetrackerEnabled(ctx) { ctx.APIError(http.StatusBadRequest, "time tracking disabled") diff --git a/routers/api/v1/repo/key.go b/routers/api/v1/repo/key.go index b0da7816e89..4856115f2c8 100644 --- a/routers/api/v1/repo/key.go +++ b/routers/api/v1/repo/key.go @@ -76,8 +76,8 @@ func ListDeployKeys(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/DeployKeyList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" opts := deploykey_model.ListDeployKeysOptions{ ListOptions: utils.GetListOptions(ctx), @@ -131,8 +131,8 @@ func GetDeployKey(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/DeployKey" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" key, err := deploykey_model.GetDeployKeyByID(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64("id")) if err != nil { @@ -201,10 +201,8 @@ func CreateDeployKey(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/DeployKey" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.CreateKeyOption](ctx) content, err := asymkey_model.CheckPublicKeyString(form.Key) @@ -249,10 +247,8 @@ func CreateDeployToken(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/DeployKey" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.CreateDeployKeyTokenOption](ctx) accessMode := util.Iif(form.ReadOnly, perm.AccessModeRead, perm.AccessModeWrite) @@ -290,10 +286,8 @@ func DeleteDeployKey(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // a key that is already gone still leaves the caller with the state it asked for if _, err := asymkey_service.DeleteDeployKey(ctx, ctx.Repo.Repository, ctx.PathParamInt64("id")); err != nil && !deploykey_model.IsErrDeployKeyNotExist(err) { diff --git a/routers/api/v1/repo/label.go b/routers/api/v1/repo/label.go index 755951debb0..83252445b0e 100644 --- a/routers/api/v1/repo/label.go +++ b/routers/api/v1/repo/label.go @@ -46,8 +46,8 @@ func ListLabels(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/LabelList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" labels, err := issues_model.GetLabelsByRepoID(ctx, ctx.Repo.Repository.ID, ctx.FormString("sort"), utils.GetListOptions(ctx)) if err != nil { @@ -92,8 +92,8 @@ func GetLabel(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Label" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" var ( l *issues_model.Label @@ -140,10 +140,8 @@ func CreateLabel(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Label" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.CreateLabelOption](ctx) @@ -202,10 +200,8 @@ func EditLabel(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Label" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.EditLabelOption](ctx) l, err := issues_model.GetLabelInRepoByID(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64("id")) @@ -265,8 +261,8 @@ func DeleteLabel(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if err := issues_model.DeleteRepoLabel(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64("id")); err != nil { ctx.APIErrorInternal(err) diff --git a/routers/api/v1/repo/language.go b/routers/api/v1/repo/language.go index 8ba85a10654..6c0f1969cb6 100644 --- a/routers/api/v1/repo/language.go +++ b/routers/api/v1/repo/language.go @@ -62,10 +62,10 @@ func GetLanguages(ctx *context.APIContext) { // type: string // required: true // responses: - // "404": - // "$ref": "#/responses/notFound" // "200": // "$ref": "#/responses/LanguageStatistics" + // default: + // "$ref": "#/responses/error" langs, err := repo_model.GetLanguageStats(ctx, ctx.Repo.Repository) if err != nil { diff --git a/routers/api/v1/repo/license.go b/routers/api/v1/repo/license.go index 9680c420d44..3b8b11768ae 100644 --- a/routers/api/v1/repo/license.go +++ b/routers/api/v1/repo/license.go @@ -30,10 +30,10 @@ func GetLicenses(ctx *context.APIContext) { // type: string // required: true // responses: - // "404": - // "$ref": "#/responses/notFound" // "200": // "$ref": "#/responses/LicensesList" + // default: + // "$ref": "#/responses/error" licenses, err := repo_model.GetRepoLicenses(ctx, ctx.Repo.Repository) if err != nil { diff --git a/routers/api/v1/repo/migrate.go b/routers/api/v1/repo/migrate.go index 8fb054762b0..cd895c1443c 100644 --- a/routers/api/v1/repo/migrate.go +++ b/routers/api/v1/repo/migrate.go @@ -49,12 +49,8 @@ func Migrate(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Repository" - // "403": - // "$ref": "#/responses/forbidden" - // "409": - // description: The repository with the same name already exists. - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.MigrateRepoOptions](ctx) diff --git a/routers/api/v1/repo/milestone.go b/routers/api/v1/repo/milestone.go index 66531ac3583..f5dd9ce8989 100644 --- a/routers/api/v1/repo/milestone.go +++ b/routers/api/v1/repo/milestone.go @@ -56,8 +56,8 @@ func ListMilestones(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/MilestoneList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" isClosed := common.ParseIssueFilterStateIsClosed(ctx.FormString("state")) @@ -107,8 +107,8 @@ func GetMilestone(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Milestone" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" milestone := getMilestoneByIDOrName(ctx) if ctx.Written() { @@ -145,8 +145,8 @@ func CreateMilestone(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Milestone" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.CreateMilestoneOption](ctx) milestone := &issues_model.Milestone{ @@ -203,8 +203,8 @@ func EditMilestone(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Milestone" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.EditMilestoneOption](ctx) milestone := getMilestoneByIDOrName(ctx) if milestone == nil { @@ -258,8 +258,8 @@ func DeleteMilestone(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" m := getMilestoneByIDOrName(ctx) if ctx.Written() { diff --git a/routers/api/v1/repo/mirror.go b/routers/api/v1/repo/mirror.go index 6630d063531..1834db8a8b1 100644 --- a/routers/api/v1/repo/mirror.go +++ b/routers/api/v1/repo/mirror.go @@ -46,10 +46,8 @@ func MirrorSync(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" repo := ctx.Repo.Repository @@ -97,14 +95,8 @@ func PushMirrorSync(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/empty" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" if !setting.Mirror.Enabled { ctx.APIError(http.StatusBadRequest, "Mirror feature is disabled") @@ -160,12 +152,8 @@ func ListPushMirrors(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PushMirrorList" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" if !setting.Mirror.Enabled { ctx.APIError(http.StatusBadRequest, "Mirror feature is disabled") @@ -218,12 +206,8 @@ func GetPushMirrorByName(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PushMirror" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" if !setting.Mirror.Enabled { ctx.APIError(http.StatusBadRequest, "Mirror feature is disabled") @@ -279,12 +263,8 @@ func AddPushMirror(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PushMirror" - // "403": - // "$ref": "#/responses/forbidden" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" if !setting.Mirror.Enabled { ctx.APIError(http.StatusBadRequest, "Mirror feature is disabled") @@ -326,9 +306,7 @@ func DeletePushMirrorByRemoteName(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" - // "400": + // default: // "$ref": "#/responses/error" if !setting.Mirror.Enabled { diff --git a/routers/api/v1/repo/notes.go b/routers/api/v1/repo/notes.go index 80e17b784b7..d6e62e39416 100644 --- a/routers/api/v1/repo/notes.go +++ b/routers/api/v1/repo/notes.go @@ -46,10 +46,8 @@ func GetNote(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Note" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" sha := ctx.PathParam("sha") if !git.IsValidRefPattern(sha) { diff --git a/routers/api/v1/repo/patch.go b/routers/api/v1/repo/patch.go index 4a016eef348..b9783369843 100644 --- a/routers/api/v1/repo/patch.go +++ b/routers/api/v1/repo/patch.go @@ -40,10 +40,8 @@ func ApplyDiffPatch(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/FileResponse" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" apiOpts, changeRepoFileOpts := getAPIChangeRepoFileOptions[*api.ApplyDiffPatchFileOptions](ctx) opts := &files.ApplyDiffPatchOptions{ Content: apiOpts.Content, diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go index f7a36da2d35..ab21b6d8015 100644 --- a/routers/api/v1/repo/pull.go +++ b/routers/api/v1/repo/pull.go @@ -107,9 +107,7 @@ func ListPullRequests(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PullRequestList" - // "404": - // "$ref": "#/responses/notFound" - // "500": + // default: // "$ref": "#/responses/error" labelIDs, err := base.StringsToInt64s(ctx.FormStrings("labels")) @@ -183,8 +181,8 @@ func GetPullRequest(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PullRequest" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" pr, err := issues_model.GetPullRequestByIndex(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64("index")) if err != nil { @@ -242,8 +240,8 @@ func GetPullRequestByBaseHead(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PullRequest" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" var headRepoID int64 var headBranch string @@ -337,8 +335,8 @@ func DownloadPullDiffOrPatch(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/string" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" pr, err := issues_model.GetPullRequestByIndex(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64("index")) if err != nil { if issues_model.IsErrPullRequestNotExist(err) { @@ -390,16 +388,8 @@ func CreatePullRequest(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/PullRequest" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "409": + // default: // "$ref": "#/responses/error" - // "422": - // "$ref": "#/responses/validationError" - // "423": - // "$ref": "#/responses/repoArchivedError" form := *web.GetForm[*api.CreatePullRequestOption](ctx) if form.Head == form.Base { @@ -591,18 +581,8 @@ func EditPullRequest(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/PullRequest" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "409": - // "$ref": "#/responses/error" - // "412": - // "$ref": "#/responses/error" - // "422": - // "$ref": "#/responses/validationError" form := web.GetForm[*api.EditPullRequestOption](ctx) pr, err := issues_model.GetPullRequestByIndex(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64("index")) @@ -826,8 +806,8 @@ func IsPullRequestMerged(ctx *context.APIContext) { // responses: // "204": // description: pull request has been merged - // "404": - // description: pull request has not been merged + // default: + // "$ref": "#/responses/error" pr, err := issues_model.GetPullRequestByIndex(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64("index")) if err != nil { @@ -876,16 +856,8 @@ func MergePullRequest(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "405": - // "$ref": "#/responses/empty" - // "409": + // default: // "$ref": "#/responses/error" - // "423": - // "$ref": "#/responses/repoArchivedError" form := web.GetForm[*forms.MergePullRequestForm](ctx) @@ -1168,14 +1140,8 @@ func UpdatePullRequest(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "409": + // default: // "$ref": "#/responses/error" - // "422": - // "$ref": "#/responses/validationError" pr, err := issues_model.GetPullRequestByIndex(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64("index")) if err != nil { @@ -1266,12 +1232,8 @@ func CancelScheduledAutoMerge(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" pullIndex := ctx.PathParamInt64("index") pull, err := issues_model.GetPullRequestByIndex(ctx, ctx.Repo.Repository.ID, pullIndex) @@ -1356,8 +1318,8 @@ func GetPullRequestCommits(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/CommitList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" pr, err := issues_model.GetPullRequestByIndex(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64("index")) if err != nil { @@ -1482,8 +1444,8 @@ func GetPullRequestFiles(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ChangedFileList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" pr, err := issues_model.GetPullRequestByIndex(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64("index")) if err != nil { diff --git a/routers/api/v1/repo/pull_review.go b/routers/api/v1/repo/pull_review.go index 874c80cc0a6..59e4c58d30b 100644 --- a/routers/api/v1/repo/pull_review.go +++ b/routers/api/v1/repo/pull_review.go @@ -58,8 +58,8 @@ func ListPullReviews(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PullReviewList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" pr, err := issues_model.GetPullRequestByIndex(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64("index")) if err != nil { @@ -137,8 +137,8 @@ func GetPullReview(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PullReview" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" review, _, statusSet := prepareSingleReview(ctx) if statusSet { @@ -187,8 +187,8 @@ func GetPullReviewComments(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PullReviewCommentList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" review, _, statusSet := prepareSingleReview(ctx) if statusSet { @@ -245,12 +245,8 @@ func CreatePullReviewCommentReply(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/PullReviewComment" - // "400": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" opts := web.GetForm[*api.CreatePullReviewCommentReplyOptions](ctx) @@ -313,12 +309,8 @@ func ResolvePullReviewComment(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "400": - // "$ref": "#/responses/validationError" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" updatePullReviewCommentResolve(ctx, true) } @@ -349,12 +341,8 @@ func UnresolvePullReviewComment(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "400": - // "$ref": "#/responses/validationError" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" updatePullReviewCommentResolve(ctx, false) } @@ -435,10 +423,8 @@ func DeletePullReview(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" review, _, statusSet := prepareSingleReview(ctx) if statusSet { @@ -494,10 +480,8 @@ func CreatePullReview(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PullReview" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" opts := web.GetForm[*api.CreatePullReviewOptions](ctx) pr, err := issues_model.GetPullRequestByIndex(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64("index")) @@ -617,10 +601,8 @@ func SubmitPullReview(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PullReview" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" opts := web.GetForm[*api.SubmitPullReviewOptions](ctx) review, pr, isWrong := prepareSingleReview(ctx) @@ -772,10 +754,8 @@ func CreateReviewRequests(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/PullReviewList" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" opts := web.GetForm[*api.PullReviewRequestOptions](ctx) apiReviewRequest(ctx, *opts, true) @@ -813,12 +793,8 @@ func DeleteReviewRequests(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "422": - // "$ref": "#/responses/validationError" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" opts := web.GetForm[*api.PullReviewRequestOptions](ctx) apiReviewRequest(ctx, *opts, false) } @@ -993,12 +969,8 @@ func DismissPullReview(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PullReview" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" opts := web.GetForm[*api.DismissPullReviewOptions](ctx) dismissReview(ctx, opts.Message, true, opts.Priors) } @@ -1036,12 +1008,8 @@ func UnDismissPullReview(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PullReview" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" dismissReview(ctx, "", false, false) } diff --git a/routers/api/v1/repo/release.go b/routers/api/v1/repo/release.go index 62c0897a470..0bbf0dcb096 100644 --- a/routers/api/v1/repo/release.go +++ b/routers/api/v1/repo/release.go @@ -61,8 +61,8 @@ func GetRelease(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Release" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" id := ctx.PathParamInt64("id") release, err := repo_model.GetReleaseForRepoByID(ctx, ctx.Repo.Repository.ID, id) @@ -108,8 +108,8 @@ func GetLatestRelease(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Release" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" release, err := repo_model.GetLatestReleaseByRepoID(ctx, ctx.Repo.Repository.ID) if err != nil && !repo_model.IsErrReleaseNotExist(err) { ctx.APIErrorInternal(err) @@ -169,8 +169,8 @@ func ListReleases(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ReleaseList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" listOptions := utils.GetListOptions(ctx) if ctx.Written() { return @@ -237,12 +237,8 @@ func CreateRelease(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Release" - // "404": - // "$ref": "#/responses/notFound" - // "409": + // default: // "$ref": "#/responses/error" - // "422": - // "$ref": "#/responses/validationError" form := web.GetForm[*api.CreateReleaseOption](ctx) if ctx.Repo.Repository.IsEmpty { @@ -343,8 +339,8 @@ func EditRelease(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Release" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.EditReleaseOption](ctx) id := ctx.PathParamInt64("id") @@ -419,10 +415,8 @@ func DeleteRelease(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" id := ctx.PathParamInt64("id") rel, err := repo_model.GetReleaseForRepoByID(ctx, ctx.Repo.Repository.ID, id) diff --git a/routers/api/v1/repo/release_attachment.go b/routers/api/v1/repo/release_attachment.go index 4a1a1f48cde..a0b45eab90a 100644 --- a/routers/api/v1/repo/release_attachment.go +++ b/routers/api/v1/repo/release_attachment.go @@ -74,8 +74,8 @@ func GetReleaseAttachment(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Attachment" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" releaseID := ctx.PathParamInt64("id") if !checkReleaseMatchRepo(ctx, releaseID) { @@ -128,8 +128,8 @@ func ListReleaseAttachments(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/AttachmentList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" releaseID := ctx.PathParamInt64("id") release, err := repo_model.GetReleaseByID(ctx, releaseID) @@ -196,11 +196,7 @@ func CreateReleaseAttachment(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Attachment" - // "400": - // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" - // "413": + // default: // "$ref": "#/responses/error" // Check if attachments are enabled @@ -305,10 +301,8 @@ func EditReleaseAttachment(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Attachment" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.EditAttachmentOptions](ctx) @@ -382,8 +376,8 @@ func DeleteReleaseAttachment(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // Check if release exists an load release releaseID := ctx.PathParamInt64("id") diff --git a/routers/api/v1/repo/release_tags.go b/routers/api/v1/repo/release_tags.go index 65338607c56..5f5f98dd658 100644 --- a/routers/api/v1/repo/release_tags.go +++ b/routers/api/v1/repo/release_tags.go @@ -39,8 +39,8 @@ func GetReleaseByTag(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Release" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" tag := ctx.PathParam("tag") @@ -97,10 +97,8 @@ func DeleteReleaseByTag(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" tag := ctx.PathParam("tag") diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index 2dc75c9b8c2..1174b103cf0 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -132,8 +132,8 @@ func Search(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/SearchResults" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" private := ctx.IsSigned && (ctx.FormString("private") == "" || ctx.FormBool("private")) @@ -294,12 +294,8 @@ func Create(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Repository" - // "400": + // default: // "$ref": "#/responses/error" - // "409": - // description: The repository with the same name already exists. - // "422": - // "$ref": "#/responses/validationError" opt := web.GetForm[*api.CreateRepoOption](ctx) if ctx.Doer.IsOrganization() { // Shouldn't reach this condition, but just in case. @@ -336,14 +332,8 @@ func Generate(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Repository" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "409": - // description: The repository with the same name already exists. - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.GenerateRepoOption](ctx) if !ctx.Repo.Repository.IsTemplate { @@ -448,12 +438,8 @@ func CreateOrgRepoDeprecated(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Repository" - // "422": - // "$ref": "#/responses/validationError" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" CreateOrgRepo(ctx) } @@ -480,12 +466,8 @@ func CreateOrgRepo(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Repository" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" - // "403": - // "$ref": "#/responses/forbidden" opt := web.GetForm[*api.CreateRepoOption](ctx) orgName := ctx.PathParam("org") org := prepareDoerCreateRepoInOrg(ctx, orgName) @@ -516,8 +498,8 @@ func Get(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Repository" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if err := ctx.Repo.Repository.LoadAttributes(ctx); err != nil { ctx.APIErrorInternal(err) @@ -544,8 +526,8 @@ func GetByID(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Repository" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" repo, err := repo_model.GetRepositoryByID(ctx, ctx.PathParamInt64("id")) if err != nil { @@ -593,12 +575,8 @@ func Edit(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Repository" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" opts := *web.GetForm[*api.EditRepoOption](ctx) @@ -1149,10 +1127,8 @@ func Delete(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" owner := ctx.Repo.Owner repo := ctx.Repo.Repository @@ -1191,8 +1167,8 @@ func GetIssueTemplates(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/IssueTemplates" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" ret := issue.ParseTemplatesFromDefaultBranch(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo) if cnt := len(ret.TemplateErrors); cnt != 0 { ctx.Resp.Header().Add("X-Gitea-Warning", "error occurs when parsing issue template: count="+strconv.Itoa(cnt)) @@ -1221,8 +1197,8 @@ func GetIssueConfig(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/RepoIssueConfig" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" issueConfig, _ := issue.GetTemplateConfigFromDefaultBranch(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo) ctx.JSON(http.StatusOK, issueConfig) } @@ -1248,8 +1224,8 @@ func ValidateIssueConfig(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/RepoIssueConfigValidation" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" _, err := issue.GetTemplateConfigFromDefaultBranch(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo) if err == nil { @@ -1292,8 +1268,8 @@ func ListRepoActivityFeeds(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ActivityFeedsList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" listOptions := utils.GetListOptions(ctx) diff --git a/routers/api/v1/repo/star.go b/routers/api/v1/repo/star.go index d5c37471ecb..48ef9933367 100644 --- a/routers/api/v1/repo/star.go +++ b/routers/api/v1/repo/star.go @@ -42,10 +42,8 @@ func ListStargazers(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/UserList" - // "404": - // "$ref": "#/responses/notFound" - // "403": - // "$ref": "#/responses/forbidden" + // default: + // "$ref": "#/responses/error" stargazers, err := repo_model.GetStargazers(ctx, ctx.Repo.Repository, utils.GetListOptions(ctx)) if err != nil { diff --git a/routers/api/v1/repo/status.go b/routers/api/v1/repo/status.go index 2fdbe3daa52..1fce240d35a 100644 --- a/routers/api/v1/repo/status.go +++ b/routers/api/v1/repo/status.go @@ -47,10 +47,8 @@ func NewCommitStatus(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/CommitStatus" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" form := web.GetForm[*api.CreateStatusOption](ctx) sha := ctx.PathParam("sha") @@ -118,10 +116,8 @@ func GetCommitStatuses(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/CommitStatusList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" getCommitStatuses(ctx, ctx.PathParam("sha")) } @@ -172,10 +168,8 @@ func GetCommitStatusesByRef(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/CommitStatusList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" refCommit := resolveRefCommit(ctx, ctx.PathParam("ref"), 7) if ctx.Written() { @@ -246,10 +240,8 @@ func GetCombinedCommitStatusByRef(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/CombinedStatus" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" refCommit := resolveRefCommit(ctx, ctx.PathParam("ref"), 7) if ctx.Written() { diff --git a/routers/api/v1/repo/subscriber.go b/routers/api/v1/repo/subscriber.go index 7f7428adcb0..974c1b73d67 100644 --- a/routers/api/v1/repo/subscriber.go +++ b/routers/api/v1/repo/subscriber.go @@ -42,8 +42,8 @@ func ListSubscribers(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/UserList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" subscribers, err := repo_model.GetRepoWatchers(ctx, ctx.Repo.Repository.ID, utils.GetListOptions(ctx)) if err != nil { diff --git a/routers/api/v1/repo/tag.go b/routers/api/v1/repo/tag.go index c4853f41388..cd76416055b 100644 --- a/routers/api/v1/repo/tag.go +++ b/routers/api/v1/repo/tag.go @@ -51,8 +51,8 @@ func ListTags(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/TagList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" listOpts := utils.GetListOptions(ctx) @@ -97,10 +97,8 @@ func GetAnnotatedTag(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/AnnotatedTag" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" sha := ctx.PathParam("sha") if len(sha) == 0 { @@ -148,8 +146,8 @@ func GetTag(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Tag" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" tagName := ctx.PathParam("*") tag, err := ctx.Repo.GitRepo.GetTag(ctx, tagName) @@ -185,16 +183,8 @@ func CreateTag(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Tag" - // "404": - // "$ref": "#/responses/notFound" - // "405": - // "$ref": "#/responses/empty" - // "409": - // "$ref": "#/responses/conflict" - // "422": - // "$ref": "#/responses/validationError" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.CreateTagOption](ctx) // If target is not provided use default branch @@ -256,16 +246,8 @@ func DeleteTag(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" - // "405": - // "$ref": "#/responses/empty" - // "409": - // "$ref": "#/responses/conflict" - // "422": - // "$ref": "#/responses/validationError" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" tagName := ctx.PathParam("*") tag, err := repo_model.GetRelease(ctx, ctx.Repo.Repository.ID, tagName) @@ -357,8 +339,8 @@ func GetTagProtection(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/TagProtection" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" repo := ctx.Repo.Repository id := ctx.PathParamInt64("id") @@ -403,14 +385,8 @@ func CreateTagProtection(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/TagProtection" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.CreateTagProtectionOption](ctx) repo := ctx.Repo.Repository @@ -515,12 +491,8 @@ func EditTagProtection(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/TagProtection" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" repo := ctx.Repo.Repository form := web.GetForm[*api.EditTagProtectionOption](ctx) @@ -616,8 +588,8 @@ func DeleteTagProtection(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" repo := ctx.Repo.Repository id := ctx.PathParamInt64("id") diff --git a/routers/api/v1/repo/teams.go b/routers/api/v1/repo/teams.go index 4aabb06a4bc..6461a4c06db 100644 --- a/routers/api/v1/repo/teams.go +++ b/routers/api/v1/repo/teams.go @@ -35,8 +35,8 @@ func ListTeams(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/TeamList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if !ctx.Repo.Owner.IsOrganization() { ctx.APIError(http.StatusMethodNotAllowed, "repo is not owned by an organization") @@ -84,9 +84,7 @@ func IsTeam(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Team" - // "404": - // "$ref": "#/responses/notFound" - // "405": + // default: // "$ref": "#/responses/error" if !ctx.Repo.Owner.IsOrganization() { @@ -138,14 +136,8 @@ func AddTeam(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "405": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" changeRepoTeam(ctx, true) } @@ -176,14 +168,8 @@ func DeleteTeam(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "405": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" changeRepoTeam(ctx, false) } diff --git a/routers/api/v1/repo/topic.go b/routers/api/v1/repo/topic.go index 4b825cddda4..f2c2d256c83 100644 --- a/routers/api/v1/repo/topic.go +++ b/routers/api/v1/repo/topic.go @@ -46,8 +46,8 @@ func ListTopics(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/TopicNames" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" opts := &repo_model.FindTopicOptions{ ListOptions: utils.GetListOptions(ctx), @@ -96,12 +96,8 @@ func UpdateTopics(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/invalidTopicsError" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.RepoTopicOptions](ctx) topicNames := form.Topics @@ -159,12 +155,8 @@ func AddTopic(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/invalidTopicsError" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" topicName := strings.TrimSpace(strings.ToLower(ctx.PathParam("topic"))) @@ -228,12 +220,8 @@ func DeleteTopic(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/invalidTopicsError" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" topicName := strings.TrimSpace(strings.ToLower(ctx.PathParam("topic"))) @@ -284,10 +272,8 @@ func TopicSearch(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/TopicListResponse" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" opts := &repo_model.FindTopicOptions{ Keyword: ctx.FormString("q"), diff --git a/routers/api/v1/repo/transfer.go b/routers/api/v1/repo/transfer.go index ef05dac65b4..8245450309e 100644 --- a/routers/api/v1/repo/transfer.go +++ b/routers/api/v1/repo/transfer.go @@ -49,12 +49,8 @@ func Transfer(ctx *context.APIContext) { // responses: // "202": // "$ref": "#/responses/Repository" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" opts := web.GetForm[*api.TransferRepoOption](ctx) @@ -154,10 +150,8 @@ func AcceptTransfer(ctx *context.APIContext) { // responses: // "202": // "$ref": "#/responses/Repository" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" err := repo_service.AcceptTransferOwnership(ctx, ctx.Repo.Repository, ctx.Doer) if err != nil { @@ -198,10 +192,8 @@ func RejectTransfer(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Repository" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" err := repo_service.RejectRepositoryTransfer(ctx, ctx.Repo.Repository, ctx.Doer) if err != nil { diff --git a/routers/api/v1/repo/tree.go b/routers/api/v1/repo/tree.go index 2514421ca69..b6570207bbd 100644 --- a/routers/api/v1/repo/tree.go +++ b/routers/api/v1/repo/tree.go @@ -51,10 +51,8 @@ func GetTree(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/GitTreeResponse" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" sha := ctx.PathParam("sha") if len(sha) == 0 { diff --git a/routers/api/v1/repo/wiki.go b/routers/api/v1/repo/wiki.go index 6c9cc0e8cfd..78f662d5da5 100644 --- a/routers/api/v1/repo/wiki.go +++ b/routers/api/v1/repo/wiki.go @@ -45,14 +45,8 @@ func NewWikiPage(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/WikiPage" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" form := web.GetForm[*api.CreateWikiPageOptions](ctx) wikiName := wiki_service.UserTitleToWebPath("", form.Title) @@ -117,14 +111,8 @@ func EditWikiPage(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WikiPage" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" form := web.GetForm[*api.CreateWikiPageOptions](ctx) @@ -227,12 +215,8 @@ func DeleteWikiPage(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" wikiName := wiki_service.WebPathFromRequest(ctx.PathParamRaw("pageName")) @@ -275,8 +259,8 @@ func ListWikiPages(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WikiPageList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" wikiRepo, commit := findWikiRepoCommit(ctx) if wikiRepo != nil { @@ -352,8 +336,8 @@ func GetWikiPage(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WikiPage" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // get requested pagename pageName := wiki_service.WebPathFromRequest(ctx.PathParamRaw("pageName")) @@ -394,8 +378,8 @@ func ListPageRevisions(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WikiCommitList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" wikiRepo, commit := findWikiRepoCommit(ctx) if wikiRepo != nil { diff --git a/routers/api/v1/shared/project.go b/routers/api/v1/shared/project.go index 9fa975eb2e3..e0afcbc1887 100644 --- a/routers/api/v1/shared/project.go +++ b/routers/api/v1/shared/project.go @@ -202,8 +202,8 @@ func ListProjects(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation GET /orgs/{org}/projects organization orgListProjects // --- @@ -233,8 +233,8 @@ func ListProjects(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation GET /user/projects user userCurrentListProjects // --- @@ -288,8 +288,8 @@ func ListProjects(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" scope := projectScopeFromContext(ctx) listOptions := utils.GetListOptions(ctx) @@ -344,8 +344,8 @@ func GetProject(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Project" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation GET /orgs/{org}/projects/{id} organization orgGetProject // --- @@ -367,8 +367,8 @@ func GetProject(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Project" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation GET /user/projects/{id} user userCurrentGetProject // --- @@ -385,8 +385,8 @@ func GetProject(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Project" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" project := projectScopeFromContext(ctx).findProject(ctx) if ctx.Written() { @@ -425,12 +425,8 @@ func CreateProject(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Project" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" // swagger:operation POST /orgs/{org}/projects organization orgCreateProject // --- @@ -452,10 +448,8 @@ func CreateProject(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Project" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation POST /user/projects user userCurrentCreateProject // --- @@ -472,8 +466,8 @@ func CreateProject(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Project" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" scope := projectScopeFromContext(ctx) form := web.GetForm[*api.CreateProjectOption](ctx) @@ -540,12 +534,8 @@ func EditProject(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Project" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" // swagger:operation PATCH /orgs/{org}/projects/{id} organization orgEditProject // --- @@ -573,10 +563,8 @@ func EditProject(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Project" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation PATCH /user/projects/{id} user userCurrentEditProject // --- @@ -599,10 +587,8 @@ func EditProject(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Project" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" project := projectScopeFromContext(ctx).findProject(ctx) if ctx.Written() { @@ -669,10 +655,8 @@ func DeleteProject(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" // swagger:operation DELETE /orgs/{org}/projects/{id} organization orgDeleteProject // --- @@ -692,8 +676,8 @@ func DeleteProject(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation DELETE /user/projects/{id} user userCurrentDeleteProject // --- @@ -708,8 +692,8 @@ func DeleteProject(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" project := projectScopeFromContext(ctx).findProject(ctx) if ctx.Written() { @@ -756,8 +740,8 @@ func ListProjectColumns(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectColumnList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation GET /orgs/{org}/projects/{id}/columns organization orgListProjectColumns // --- @@ -787,8 +771,8 @@ func ListProjectColumns(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectColumnList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation GET /user/projects/{id}/columns user userCurrentListProjectColumns // --- @@ -813,8 +797,8 @@ func ListProjectColumns(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectColumnList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" project := projectScopeFromContext(ctx).findProject(ctx) if ctx.Written() { @@ -870,14 +854,8 @@ func CreateProjectColumn(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/ProjectColumn" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" // swagger:operation POST /orgs/{org}/projects/{id}/columns organization orgCreateProjectColumn // --- @@ -905,12 +883,8 @@ func CreateProjectColumn(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/ProjectColumn" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation POST /user/projects/{id}/columns user userCurrentCreateProjectColumn // --- @@ -933,12 +907,8 @@ func CreateProjectColumn(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/ProjectColumn" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" project := projectScopeFromContext(ctx).findOpenProject(ctx) if ctx.Written() { @@ -991,8 +961,8 @@ func GetProjectColumn(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectColumn" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation GET /orgs/{org}/projects/{id}/columns/{column_id} organization orgGetProjectColumn // --- @@ -1020,8 +990,8 @@ func GetProjectColumn(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectColumn" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation GET /user/projects/{id}/columns/{column_id} user userCurrentGetProjectColumn // --- @@ -1044,8 +1014,8 @@ func GetProjectColumn(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectColumn" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" _, column := projectScopeFromContext(ctx).findColumn(ctx) if ctx.Written() { @@ -1092,14 +1062,8 @@ func EditProjectColumn(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectColumn" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" // swagger:operation PATCH /orgs/{org}/projects/{id}/columns/{column_id} organization orgEditProjectColumn // --- @@ -1133,12 +1097,8 @@ func EditProjectColumn(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectColumn" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation PATCH /user/projects/{id}/columns/{column_id} user userCurrentEditProjectColumn // --- @@ -1167,12 +1127,8 @@ func EditProjectColumn(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectColumn" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" _, column := projectScopeFromContext(ctx).findOpenColumn(ctx) if ctx.Written() { @@ -1232,14 +1188,8 @@ func DeleteProjectColumn(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" // swagger:operation DELETE /orgs/{org}/projects/{id}/columns/{column_id} organization orgDeleteProjectColumn // --- @@ -1266,12 +1216,8 @@ func DeleteProjectColumn(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation DELETE /user/projects/{id}/columns/{column_id} user userCurrentDeleteProjectColumn // --- @@ -1293,12 +1239,8 @@ func DeleteProjectColumn(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" _, column := projectScopeFromContext(ctx).findOpenColumn(ctx) if ctx.Written() { @@ -1342,12 +1284,8 @@ func SetDefaultProjectColumn(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" // swagger:operation POST /orgs/{org}/projects/{id}/columns/{column_id}/default organization orgSetDefaultProjectColumn // --- @@ -1374,10 +1312,8 @@ func SetDefaultProjectColumn(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation POST /user/projects/{id}/columns/{column_id}/default user userCurrentSetDefaultProjectColumn // --- @@ -1399,10 +1335,8 @@ func SetDefaultProjectColumn(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" project, column := projectScopeFromContext(ctx).findOpenColumn(ctx) if ctx.Written() { @@ -1446,14 +1380,8 @@ func MoveProjectColumns(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" // swagger:operation POST /orgs/{org}/projects/{id}/columns/move organization orgMoveProjectColumns // --- @@ -1480,12 +1408,8 @@ func MoveProjectColumns(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation POST /user/projects/{id}/columns/move user userCurrentMoveProjectColumns // --- @@ -1507,12 +1431,8 @@ func MoveProjectColumns(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" project := projectScopeFromContext(ctx).findOpenProject(ctx) if ctx.Written() { @@ -1582,8 +1502,8 @@ func ListProjectColumnIssues(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/IssueList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation GET /orgs/{org}/projects/{id}/columns/{column_id}/issues organization orgListProjectColumnIssues // --- @@ -1619,8 +1539,8 @@ func ListProjectColumnIssues(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/IssueList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation GET /user/projects/{id}/columns/{column_id}/issues user userCurrentListProjectColumnIssues // --- @@ -1651,8 +1571,8 @@ func ListProjectColumnIssues(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/IssueList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" scope := projectScopeFromContext(ctx) project, column := scope.findColumn(ctx) @@ -1744,14 +1664,8 @@ func AddIssueToProjectColumn(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" // swagger:operation POST /orgs/{org}/projects/{id}/columns/{column_id}/issues/{issue_id} organization orgAddIssueToProjectColumn // --- @@ -1784,14 +1698,8 @@ func AddIssueToProjectColumn(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" // swagger:operation POST /user/projects/{id}/columns/{column_id}/issues/{issue_id} user userCurrentAddIssueToProjectColumn // --- @@ -1819,14 +1727,8 @@ func AddIssueToProjectColumn(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" column, issue := projectScopeFromContext(ctx).findColumnIssue(ctx) if ctx.Written() { @@ -1875,12 +1777,8 @@ func RemoveIssueFromProjectColumn(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" // swagger:operation DELETE /orgs/{org}/projects/{id}/columns/{column_id}/issues/{issue_id} organization orgRemoveIssueFromProjectColumn // --- @@ -1912,12 +1810,8 @@ func RemoveIssueFromProjectColumn(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" // swagger:operation DELETE /user/projects/{id}/columns/{column_id}/issues/{issue_id} user userCurrentRemoveIssueFromProjectColumn // --- @@ -1944,12 +1838,8 @@ func RemoveIssueFromProjectColumn(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" column, issue := projectScopeFromContext(ctx).findColumnIssue(ctx) if ctx.Written() { @@ -1998,14 +1888,8 @@ func MoveProjectIssue(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" // swagger:operation POST /orgs/{org}/projects/{id}/issues/{issue_id}/move organization orgMoveProjectIssue // --- @@ -2037,14 +1921,8 @@ func MoveProjectIssue(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" // swagger:operation POST /user/projects/{id}/issues/{issue_id}/move user userCurrentMoveProjectIssue // --- @@ -2071,14 +1949,8 @@ func MoveProjectIssue(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" scope := projectScopeFromContext(ctx) project := scope.findOpenProject(ctx) diff --git a/routers/api/v1/shared/project_workflow.go b/routers/api/v1/shared/project_workflow.go index 2bdfcd0af42..c5472e70a1f 100644 --- a/routers/api/v1/shared/project_workflow.go +++ b/routers/api/v1/shared/project_workflow.go @@ -59,8 +59,8 @@ func ListProjectWorkflows(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectWorkflowList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation GET /orgs/{org}/projects/{id}/workflows organization orgListProjectWorkflows // --- @@ -90,8 +90,8 @@ func ListProjectWorkflows(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectWorkflowList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation GET /user/projects/{id}/workflows user userCurrentListProjectWorkflows // --- @@ -116,8 +116,8 @@ func ListProjectWorkflows(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectWorkflowList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" project := projectScopeFromContext(ctx).findProject(ctx) if ctx.Written() { @@ -166,8 +166,8 @@ func GetProjectWorkflow(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectWorkflow" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation GET /orgs/{org}/projects/{id}/workflows/{workflow_id} organization orgGetProjectWorkflow // --- @@ -195,8 +195,8 @@ func GetProjectWorkflow(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectWorkflow" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation GET /user/projects/{id}/workflows/{workflow_id} user userCurrentGetProjectWorkflow // --- @@ -219,8 +219,8 @@ func GetProjectWorkflow(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectWorkflow" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" project := projectScopeFromContext(ctx).findProject(ctx) if ctx.Written() { @@ -265,14 +265,8 @@ func CreateProjectWorkflow(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/ProjectWorkflow" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" // swagger:operation POST /orgs/{org}/projects/{id}/workflows organization orgCreateProjectWorkflow // --- @@ -300,12 +294,8 @@ func CreateProjectWorkflow(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/ProjectWorkflow" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" // swagger:operation POST /user/projects/{id}/workflows user userCurrentCreateProjectWorkflow // --- @@ -328,12 +318,8 @@ func CreateProjectWorkflow(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/ProjectWorkflow" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" project := projectScopeFromContext(ctx).findOpenProject(ctx) if ctx.Written() { @@ -385,14 +371,8 @@ func EditProjectWorkflow(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectWorkflow" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" // swagger:operation PATCH /orgs/{org}/projects/{id}/workflows/{workflow_id} organization orgEditProjectWorkflow // --- @@ -426,12 +406,8 @@ func EditProjectWorkflow(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectWorkflow" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" // swagger:operation PATCH /user/projects/{id}/workflows/{workflow_id} user userCurrentEditProjectWorkflow // --- @@ -460,12 +436,8 @@ func EditProjectWorkflow(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ProjectWorkflow" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" project := projectScopeFromContext(ctx).findOpenProject(ctx) if ctx.Written() { @@ -512,12 +484,8 @@ func DeleteProjectWorkflow(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "423": - // "$ref": "#/responses/repoArchivedError" + // default: + // "$ref": "#/responses/error" // swagger:operation DELETE /orgs/{org}/projects/{id}/workflows/{workflow_id} organization orgDeleteProjectWorkflow // --- @@ -543,10 +511,8 @@ func DeleteProjectWorkflow(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" // swagger:operation DELETE /user/projects/{id}/workflows/{workflow_id} user userCurrentDeleteProjectWorkflow // --- @@ -567,10 +533,8 @@ func DeleteProjectWorkflow(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" project := projectScopeFromContext(ctx).findOpenProject(ctx) if ctx.Written() { diff --git a/routers/api/v1/swagger/repo.go b/routers/api/v1/swagger/repo.go index dcdfe062c9c..e6cc3189a43 100644 --- a/routers/api/v1/swagger/repo.go +++ b/routers/api/v1/swagger/repo.go @@ -303,13 +303,6 @@ type swaggerNote struct { Body api.Note `json:"body"` } -// EmptyRepository -// swagger:response EmptyRepository -type swaggerEmptyRepository struct { - // in: body - Body api.APIError `json:"body"` -} - // FileResponse // swagger:response FileResponse type swaggerFileResponse struct { diff --git a/routers/api/v1/user/action.go b/routers/api/v1/user/action.go index 8412ce4b455..91651e4f02a 100644 --- a/routers/api/v1/user/action.go +++ b/routers/api/v1/user/action.go @@ -44,10 +44,8 @@ func CreateOrUpdateSecret(ctx *context.APIContext) { // description: response when creating a secret // "204": // description: response when updating a secret - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" opt := web.GetForm[*api.CreateOrUpdateSecretOption](ctx) @@ -88,10 +86,8 @@ func DeleteSecret(ctx *context.APIContext) { // responses: // "204": // description: delete one secret of the user - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" s, err := secret_service.DeleteSecretByName(ctx, actions_model.BelongingScopeOwner(ctx.Doer.ID), ctx.PathParam("secretname")) if err != nil { @@ -126,10 +122,8 @@ func CreateVariable(ctx *context.APIContext) { // responses: // "201": // description: successfully created the user-level variable - // "400": + // default: // "$ref": "#/responses/error" - // "409": - // description: variable name already exists. opt := web.GetForm[*api.CreateVariableOption](ctx) @@ -181,10 +175,8 @@ func UpdateVariable(ctx *context.APIContext) { // description: response when updating a variable // "204": // description: response when updating a variable - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" opt := web.GetForm[*api.UpdateVariableOption](ctx) @@ -231,10 +223,8 @@ func DeleteVariable(ctx *context.APIContext) { // description: response when deleting a variable // "204": // description: response when deleting a variable - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" if err := actions_service.DeleteVariableByName(ctx, actions_model.BelongingScopeOwner(ctx.Doer.ID), ctx.PathParam("variablename")); err != nil { ctx.APIErrorAuto(err) @@ -260,10 +250,8 @@ func GetVariable(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ActionVariable" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" v, err := actions_service.GetVariable(ctx, actions_model.FindVariablesOpts{ BelongingScope: actions_model.BelongingScopeOwner(ctx.Doer.ID), @@ -304,10 +292,8 @@ func ListVariables(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/VariableList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" listOptions := utils.GetListOptions(ctx) vars, count, err := db.FindAndCount[actions_model.ActionVariable](ctx, &actions_model.FindVariablesOpts{ BelongingScope: actions_model.BelongingScopeOwner(ctx.Doer.ID), @@ -378,10 +364,8 @@ func ListWorkflowRuns(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WorkflowRunsList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" shared.ListRuns(ctx, ctx.Doer.ID, 0, "") } @@ -417,12 +401,8 @@ func ListWorkflowJobs(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WorkflowJobsList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" shared.ListJobs(ctx, ctx.Doer.ID, 0, 0, nil) } diff --git a/routers/api/v1/user/app.go b/routers/api/v1/user/app.go index 6a7785f8557..201001ff33e 100644 --- a/routers/api/v1/user/app.go +++ b/routers/api/v1/user/app.go @@ -47,8 +47,8 @@ func ListAccessTokens(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/AccessTokenList" - // "403": - // "$ref": "#/responses/forbidden" + // default: + // "$ref": "#/responses/error" opts := auth_model.ListAccessTokensOptions{UserID: ctx.ContextUser.ID, ListOptions: utils.GetListOptions(ctx)} @@ -96,10 +96,8 @@ func CreateAccessToken(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/AccessToken" - // "400": + // default: // "$ref": "#/responses/error" - // "403": - // "$ref": "#/responses/forbidden" form := web.GetForm[*api.CreateAccessTokenOption](ctx) @@ -185,11 +183,7 @@ func DeleteAccessToken(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": + // default: // "$ref": "#/responses/error" token := ctx.PathParam("id") @@ -249,7 +243,7 @@ func CreateOauth2Application(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/OAuth2Application" - // "400": + // default: // "$ref": "#/responses/error" data := web.GetForm[*api.CreateOAuth2ApplicationOptions](ctx) @@ -336,8 +330,8 @@ func DeleteOauth2Application(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" appID := ctx.PathParamInt64("id") app, err := auth_model.GetOAuth2ApplicationByID(ctx, appID) if err != nil { @@ -379,8 +373,8 @@ func GetOauth2Application(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/OAuth2Application" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" appID := ctx.PathParamInt64("id") app, err := auth_model.GetOAuth2ApplicationByID(ctx, appID) if err != nil { @@ -423,10 +417,8 @@ func UpdateOauth2Application(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/OAuth2Application" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" appID := ctx.PathParamInt64("id") data := web.GetForm[*api.CreateOAuth2ApplicationOptions](ctx) diff --git a/routers/api/v1/user/block.go b/routers/api/v1/user/block.go index 268ef7da90f..5702f17ba72 100644 --- a/routers/api/v1/user/block.go +++ b/routers/api/v1/user/block.go @@ -43,8 +43,8 @@ func CheckUserBlock(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" shared.CheckUserBlock(ctx, ctx.Doer) } @@ -66,10 +66,8 @@ func BlockUser(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" shared.BlockUser(ctx, ctx.Doer) } @@ -87,10 +85,8 @@ func UnblockUser(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" shared.UnblockUser(ctx, ctx.Doer, ctx.Doer) } diff --git a/routers/api/v1/user/email.go b/routers/api/v1/user/email.go index b642e81e06a..0bffb1775cd 100644 --- a/routers/api/v1/user/email.go +++ b/routers/api/v1/user/email.go @@ -54,12 +54,8 @@ func AddEmail(ctx *context.APIContext) { // responses: // '201': // "$ref": "#/responses/EmailList" - // "400": + // default: // "$ref": "#/responses/error" - // "409": - // "$ref": "#/responses/error" - // "422": - // "$ref": "#/responses/validationError" if user_model.IsFeatureDisabledWithLoginType(ctx.Doer, setting.UserFeatureManageCredentials) { ctx.APIErrorNotFound("emails are not allowed to be changed") @@ -105,8 +101,8 @@ func DeleteEmail(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if user_model.IsFeatureDisabledWithLoginType(ctx.Doer, setting.UserFeatureManageCredentials) { ctx.APIErrorNotFound("emails are not allowed to be changed") diff --git a/routers/api/v1/user/follower.go b/routers/api/v1/user/follower.go index 47eabb5351d..e198463083b 100644 --- a/routers/api/v1/user/follower.go +++ b/routers/api/v1/user/follower.go @@ -83,8 +83,8 @@ func ListFollowers(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/UserList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" listUserFollowers(ctx, ctx.ContextUser) } @@ -149,8 +149,8 @@ func ListFollowing(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/UserList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" listUserFollowing(ctx, ctx.ContextUser) } @@ -177,8 +177,8 @@ func CheckMyFollowing(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" checkUserFollowing(ctx, ctx.Doer, ctx.ContextUser.ID) } @@ -202,8 +202,8 @@ func CheckFollowing(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" target := GetUserByPathParam(ctx, "target") // FIXME: it is not right to call this function, it should load the "target" directly if ctx.Written() { @@ -226,10 +226,8 @@ func Follow(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if err := user_model.FollowUser(ctx, ctx.Doer, ctx.ContextUser); err != nil { if errors.Is(err, user_model.ErrBlockedUser) { @@ -256,8 +254,8 @@ func Unfollow(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if err := user_model.UnfollowUser(ctx, ctx.Doer.ID, ctx.ContextUser.ID); err != nil { ctx.APIErrorInternal(err) diff --git a/routers/api/v1/user/gpg_key.go b/routers/api/v1/user/gpg_key.go index 58637775a36..9ad011218e4 100644 --- a/routers/api/v1/user/gpg_key.go +++ b/routers/api/v1/user/gpg_key.go @@ -66,8 +66,8 @@ func ListGPGKeys(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/GPGKeyList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" listGPGKeys(ctx, ctx.ContextUser.ID, utils.GetListOptions(ctx)) } @@ -91,10 +91,8 @@ func ListMyGPGKeys(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/GPGKeyList" - // "401": - // "$ref": "#/responses/unauthorized" - // "403": - // "$ref": "#/responses/forbidden" + // default: + // "$ref": "#/responses/error" listGPGKeys(ctx, ctx.Doer.ID, utils.GetListOptions(ctx)) } @@ -116,12 +114,8 @@ func GetGPGKey(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/GPGKey" - // "401": - // "$ref": "#/responses/unauthorized" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" key, err := asymkey_model.GetGPGKeyForUserByID(ctx, ctx.Doer.ID, ctx.PathParamInt64("id")) if err != nil { @@ -171,12 +165,8 @@ func GetVerificationToken(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/string" - // "401": - // "$ref": "#/responses/unauthorized" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" token := asymkey_model.VerificationToken(ctx.Doer, 1) ctx.PlainText(http.StatusOK, token) @@ -194,14 +184,8 @@ func VerifyUserGPGKey(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/GPGKey" - // "401": - // "$ref": "#/responses/unauthorized" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.VerifyGPGKeyOption](ctx) token := asymkey_model.VerificationToken(ctx.Doer, 1) @@ -259,14 +243,8 @@ func CreateGPGKey(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/GPGKey" - // "401": - // "$ref": "#/responses/unauthorized" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.CreateGPGKeyOption](ctx) CreateUserGPGKey(ctx, *form, ctx.Doer.ID) @@ -289,12 +267,8 @@ func DeleteGPGKey(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "401": - // "$ref": "#/responses/unauthorized" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if user_model.IsFeatureDisabledWithLoginType(ctx.Doer, setting.UserFeatureManageGPGKeys) { ctx.APIErrorNotFound("gpg keys setting is not allowed to be changed") diff --git a/routers/api/v1/user/key.go b/routers/api/v1/user/key.go index 76e8fb9d642..5d74e34779f 100644 --- a/routers/api/v1/user/key.go +++ b/routers/api/v1/user/key.go @@ -121,10 +121,8 @@ func ListMyPublicKeys(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PublicKeyList" - // "401": - // "$ref": "#/responses/unauthorized" - // "403": - // "$ref": "#/responses/forbidden" + // default: + // "$ref": "#/responses/error" listPublicKeys(ctx, ctx.Doer) } @@ -157,8 +155,8 @@ func ListPublicKeys(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PublicKeyList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" listPublicKeys(ctx, ctx.ContextUser) } @@ -180,12 +178,8 @@ func GetPublicKey(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/PublicKey" - // "401": - // "$ref": "#/responses/unauthorized" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" key, err := asymkey_model.GetPublicKeyByID(ctx, ctx.PathParamInt64("id")) if err != nil { @@ -248,12 +242,8 @@ func CreatePublicKey(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/PublicKey" - // "401": - // "$ref": "#/responses/unauthorized" - // "403": - // "$ref": "#/responses/forbidden" - // "422": - // "$ref": "#/responses/validationError" + // default: + // "$ref": "#/responses/error" form := web.GetForm[*api.CreateKeyOption](ctx) CreateUserPublicKey(ctx, *form, ctx.Doer.ID) @@ -276,12 +266,8 @@ func DeletePublicKey(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "401": - // "$ref": "#/responses/unauthorized" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if user_model.IsFeatureDisabledWithLoginType(ctx.Doer, setting.UserFeatureManageSSHKeys) { ctx.APIErrorNotFound("ssh keys setting is not allowed to be changed") diff --git a/routers/api/v1/user/repo.go b/routers/api/v1/user/repo.go index 1743aa37ff0..0f0389d371d 100644 --- a/routers/api/v1/user/repo.go +++ b/routers/api/v1/user/repo.go @@ -77,8 +77,8 @@ func ListUserRepos(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/RepositoryList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" listUserRepos(ctx, ctx.ContextUser, ctx.IsSigned) } @@ -159,8 +159,8 @@ func ListOrgRepos(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/RepositoryList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" listUserRepos(ctx, ctx.Org.Organization.AsUser(), ctx.IsSigned) } diff --git a/routers/api/v1/user/runners.go b/routers/api/v1/user/runners.go index dcfc60c5b99..c25bd462a63 100644 --- a/routers/api/v1/user/runners.go +++ b/routers/api/v1/user/runners.go @@ -41,10 +41,8 @@ func ListRunners(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/RunnerList" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" shared.ListRunners(ctx, ctx.Doer.ID, 0) } @@ -64,10 +62,8 @@ func GetRunner(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Runner" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" shared.GetRunner(ctx, ctx.Doer.ID, 0, ctx.PathParamInt64("runner_id")) } @@ -87,10 +83,8 @@ func DeleteRunner(ctx *context.APIContext) { // responses: // "204": // description: runner has been deleted - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" shared.DeleteRunner(ctx, ctx.Doer.ID, 0, ctx.PathParamInt64("runner_id")) } @@ -116,11 +110,7 @@ func UpdateRunner(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/Runner" - // "400": + // default: // "$ref": "#/responses/error" - // "404": - // "$ref": "#/responses/notFound" - // "422": - // "$ref": "#/responses/validationError" shared.UpdateRunner(ctx, ctx.Doer.ID, 0, ctx.PathParamInt64("runner_id")) } diff --git a/routers/api/v1/user/star.go b/routers/api/v1/user/star.go index 864dc070074..397ebe209b1 100644 --- a/routers/api/v1/user/star.go +++ b/routers/api/v1/user/star.go @@ -70,10 +70,8 @@ func GetStarredRepos(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/RepositoryList" - // "404": - // "$ref": "#/responses/notFound" - // "403": - // "$ref": "#/responses/forbidden" + // default: + // "$ref": "#/responses/error" private := ctx.ContextUser.ID == ctx.Doer.ID repos, err := getStarredRepos(ctx, ctx.ContextUser, private) @@ -106,8 +104,8 @@ func GetMyStarredRepos(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/RepositoryList" - // "403": - // "$ref": "#/responses/forbidden" + // default: + // "$ref": "#/responses/error" repos, err := getStarredRepos(ctx, ctx.Doer, true) if err != nil { @@ -138,10 +136,8 @@ func IsStarring(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" - // "403": - // "$ref": "#/responses/forbidden" + // default: + // "$ref": "#/responses/error" if repo_model.IsStaring(ctx, ctx.Doer.ID, ctx.Repo.Repository.ID) { ctx.Status(http.StatusNoContent) @@ -169,10 +165,8 @@ func Star(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" err := repo_model.StarRepo(ctx, ctx.Doer, ctx.Repo.Repository, true) if err != nil { @@ -205,10 +199,8 @@ func Unstar(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" - // "403": - // "$ref": "#/responses/forbidden" + // default: + // "$ref": "#/responses/error" err := repo_model.StarRepo(ctx, ctx.Doer, ctx.Repo.Repository, false) if err != nil { diff --git a/routers/api/v1/user/user.go b/routers/api/v1/user/user.go index 544bbc940be..2545e5dca24 100644 --- a/routers/api/v1/user/user.go +++ b/routers/api/v1/user/user.go @@ -109,8 +109,8 @@ func GetInfo(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/User" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" if !user_model.IsUserVisibleToViewer(ctx, ctx.ContextUser, ctx.Doer) { // fake ErrUserNotExist error message to not leak information about existence @@ -150,8 +150,8 @@ func GetUserHeatmapData(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/UserHeatmapData" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" heatmap, err := activities_model.GetUserHeatmapDataByUser(ctx, ctx.ContextUser, ctx.Doer) if err != nil { @@ -193,8 +193,8 @@ func ListUserActivityFeeds(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/ActivityFeedsList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" includePrivate := ctx.IsSigned && (ctx.Doer.IsAdmin || ctx.Doer.ID == ctx.ContextUser.ID) listOptions := utils.GetListOptions(ctx) diff --git a/routers/api/v1/user/watch.go b/routers/api/v1/user/watch.go index f552fd9f28d..9789a016d21 100644 --- a/routers/api/v1/user/watch.go +++ b/routers/api/v1/user/watch.go @@ -65,8 +65,8 @@ func GetWatchedRepos(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/RepositoryList" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" private := ctx.ContextUser.ID == ctx.Doer.ID repos, total, err := getWatchedRepos(ctx, ctx.ContextUser, private) @@ -128,8 +128,8 @@ func IsWatching(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WatchInfo" - // "404": - // description: User is not watching this repo or repo do not exist + // default: + // "$ref": "#/responses/error" if repo_model.IsWatchingRepo(ctx, ctx.Doer.ID, ctx.Repo.Repository.ID) { ctx.JSON(http.StatusOK, api.WatchInfo{ @@ -164,10 +164,8 @@ func Watch(ctx *context.APIContext) { // responses: // "200": // "$ref": "#/responses/WatchInfo" - // "403": - // "$ref": "#/responses/forbidden" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" err := repo_model.WatchRepoAuto(ctx, ctx.Doer, ctx.Repo.Repository, true) if err != nil { @@ -207,8 +205,8 @@ func Unwatch(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - // "404": - // "$ref": "#/responses/notFound" + // default: + // "$ref": "#/responses/error" err := repo_model.WatchRepoAuto(ctx, ctx.Doer, ctx.Repo.Repository, false) if err != nil { diff --git a/services/context/api.go b/services/context/api.go index 3557f2f0b06..f248a1951fe 100644 --- a/services/context/api.go +++ b/services/context/api.go @@ -66,54 +66,14 @@ type APIError struct { URL string `json:"url"` } -// APIValidationError is error format response related to input validation -// swagger:response validationError -type APIValidationError struct { - Message string `json:"message"` - URL string `json:"url"` -} - -// APIInvalidTopicsError is error format response to invalid topics -// swagger:response invalidTopicsError -type APIInvalidTopicsError struct { - Message string `json:"message"` - InvalidTopics []string `json:"invalidTopics"` -} - // APIEmpty is an empty response // swagger:response empty type APIEmpty struct{} -// APIForbiddenError is a forbidden error response -// swagger:response forbidden -type APIForbiddenError struct { - APIError -} - -// APIUnauthorizedError is an unauthorized error response -// swagger:response unauthorized -type APIUnauthorizedError struct { - APIError -} - -// APINotFound is a not found empty response -// swagger:response notFound -type APINotFound struct{} - -// APIConflict is a conflict empty response -// swagger:response conflict -type APIConflict struct{} - // APIString is a string response // swagger:response string type APIString string -// APIRepoArchivedError is an error that is raised when an archived repo should be modified -// swagger:response repoArchivedError -type APIRepoArchivedError struct { - APIError -} - // APIErrorInternal responds with error message, status is 500 func (ctx *APIContext) APIErrorInternal(err error) { ctx.apiErrorInternal(1, err) diff --git a/templates/swagger/v1-openapi3.generated.json b/templates/swagger/v1-openapi3.generated.json index 77d971a4f70..970ce5120f2 100644 --- a/templates/swagger/v1-openapi3.generated.json +++ b/templates/swagger/v1-openapi3.generated.json @@ -445,16 +445,6 @@ }, "description": "EmailList" }, - "EmptyRepository": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/APIError" - } - } - }, - "description": "EmptyRepository" - }, "FileDeleteResponse": { "content": { "application/json": { @@ -1675,9 +1665,6 @@ }, "description": "WorkflowRunsList" }, - "conflict": { - "description": "APIConflict is a conflict empty response" - }, "empty": { "description": "APIEmpty is an empty response" }, @@ -1696,57 +1683,6 @@ } } }, - "forbidden": { - "description": "APIForbiddenError is a forbidden error response", - "headers": { - "message": { - "schema": { - "type": "string" - } - }, - "url": { - "schema": { - "type": "string" - } - } - } - }, - "invalidTopicsError": { - "description": "APIInvalidTopicsError is error format response to invalid topics", - "headers": { - "invalidTopics": { - "schema": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "message": { - "schema": { - "type": "string" - } - } - } - }, - "notFound": { - "description": "APINotFound is a not found empty response" - }, - "repoArchivedError": { - "description": "APIRepoArchivedError is an error that is raised when an archived repo should be modified", - "headers": { - "message": { - "schema": { - "type": "string" - } - }, - "url": { - "schema": { - "type": "string" - } - } - } - }, "string": { "content": { "application/json": { @@ -1756,57 +1692,9 @@ } }, "description": "APIString is a string response" - }, - "unauthorized": { - "description": "APIUnauthorizedError is an unauthorized error response", - "headers": { - "message": { - "schema": { - "type": "string" - } - }, - "url": { - "schema": { - "type": "string" - } - } - } - }, - "validationError": { - "description": "APIValidationError is error format response related to input validation", - "headers": { - "message": { - "schema": { - "type": "string" - } - }, - "url": { - "schema": { - "type": "string" - } - } - } } }, "schemas": { - "APIError": { - "description": "APIError is an api error with a message", - "properties": { - "message": { - "description": "Message contains the error description", - "type": "string", - "x-go-name": "Message" - }, - "url": { - "description": "URL contains the documentation URL for this error", - "format": "uri", - "type": "string", - "x-go-name": "URL" - } - }, - "type": "object", - "x-go-package": "gitea.dev/modules/structs" - }, "AccessLevelName": { "enum": [ "none", @@ -11516,14 +11404,8 @@ "200": { "$ref": "#/components/responses/WorkflowJobsList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Lists all jobs", @@ -11549,11 +11431,8 @@ "200": { "$ref": "#/components/responses/RunnerList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get all runners", @@ -11594,11 +11473,8 @@ "204": { "description": "runner has been deleted" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Delete a global runner", @@ -11623,11 +11499,8 @@ "200": { "$ref": "#/components/responses/Runner" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get a global runner", @@ -11662,14 +11535,8 @@ "200": { "$ref": "#/components/responses/Runner" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Update a global runner", @@ -11743,11 +11610,8 @@ "200": { "$ref": "#/components/responses/WorkflowRunsList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Lists all runs", @@ -11781,8 +11645,8 @@ "200": { "$ref": "#/components/responses/CronList" }, - "403": { - "$ref": "#/components/responses/forbidden" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List cron tasks", @@ -11809,8 +11673,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Run cron task", @@ -11844,8 +11708,8 @@ "200": { "$ref": "#/components/responses/EmailList" }, - "403": { - "$ref": "#/components/responses/forbidden" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List all emails", @@ -11887,8 +11751,8 @@ "200": { "$ref": "#/components/responses/EmailList" }, - "403": { - "$ref": "#/components/responses/forbidden" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Search all emails", @@ -12075,8 +11939,8 @@ "200": { "$ref": "#/components/responses/OrganizationList" }, - "403": { - "$ref": "#/components/responses/forbidden" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List all organizations", @@ -12150,8 +12014,8 @@ "200": { "$ref": "#/components/responses/PackageList" }, - "403": { - "$ref": "#/components/responses/forbidden" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List all packages", @@ -12193,8 +12057,8 @@ "200": { "$ref": "#/components/responses/StringSlice" }, - "403": { - "$ref": "#/components/responses/forbidden" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List unadopted repositories", @@ -12230,8 +12094,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete unadopted files", @@ -12265,11 +12129,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Adopt unadopted files as a repository", @@ -12392,11 +12253,8 @@ "200": { "$ref": "#/components/responses/UserList" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Search users according filter conditions", @@ -12420,17 +12278,8 @@ "201": { "$ref": "#/components/responses/User" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "409": { - "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Create a user", @@ -12465,14 +12314,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a user", @@ -12507,17 +12350,8 @@ "200": { "$ref": "#/components/responses/User" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "409": { - "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Edit an existing user", @@ -12554,11 +12388,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Remove a badge from a user", @@ -12583,8 +12414,8 @@ "200": { "$ref": "#/components/responses/BadgeList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a user's badges", @@ -12619,8 +12450,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Add a badge to a user", @@ -12657,11 +12488,8 @@ "201": { "$ref": "#/components/responses/PublicKey" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Add a public key on behalf of a user", @@ -12698,11 +12526,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a user's public key", @@ -12740,11 +12565,8 @@ "201": { "$ref": "#/components/responses/Organization" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create an organization", @@ -12782,11 +12604,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Rename a user", @@ -12824,20 +12643,8 @@ "201": { "$ref": "#/components/responses/Repository" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { - "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Create a repository on behalf of a user", @@ -12878,8 +12685,8 @@ "200": { "$ref": "#/components/responses/GitignoreTemplateInfo" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Returns information about a gitignore template", @@ -12920,8 +12727,8 @@ "200": { "$ref": "#/components/responses/LabelTemplateInfo" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Returns all labels in a template", @@ -12962,8 +12769,8 @@ "200": { "$ref": "#/components/responses/LicenseTemplateInfo" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Returns information about a license template", @@ -12989,8 +12796,8 @@ "200": { "$ref": "#/components/responses/MarkdownRender" }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Render a markdown document as HTML", @@ -13018,8 +12825,8 @@ "200": { "$ref": "#/components/responses/MarkdownRender" }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Render raw markdown as HTML", @@ -13045,8 +12852,8 @@ "200": { "$ref": "#/components/responses/MarkupRender" }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Render a markup document as HTML", @@ -13229,11 +13036,8 @@ "200": { "$ref": "#/components/responses/NotificationThread" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get notification thread by ID", @@ -13267,11 +13071,8 @@ "205": { "$ref": "#/components/responses/NotificationThread" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Mark notification thread as read by ID", @@ -13309,14 +13110,8 @@ "201": { "$ref": "#/components/responses/Repository" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a repository in an organization", @@ -13373,11 +13168,8 @@ "201": { "$ref": "#/components/responses/Organization" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create an organization", @@ -13404,8 +13196,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete an organization", @@ -13430,8 +13222,8 @@ "200": { "$ref": "#/components/responses/Organization" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get an organization", @@ -13467,8 +13259,8 @@ "200": { "$ref": "#/components/responses/Organization" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Edit an organization", @@ -13519,11 +13311,8 @@ "200": { "$ref": "#/components/responses/WorkflowJobsList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get org-level workflow jobs", @@ -13558,11 +13347,8 @@ "200": { "$ref": "#/components/responses/RunnerList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get org-level runners", @@ -13623,11 +13409,8 @@ "204": { "description": "runner has been deleted" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Delete an org-level runner", @@ -13661,11 +13444,8 @@ "200": { "$ref": "#/components/responses/Runner" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get an org-level runner", @@ -13709,14 +13489,8 @@ "200": { "$ref": "#/components/responses/Runner" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Update an org-level runner", @@ -13799,11 +13573,8 @@ "200": { "$ref": "#/components/responses/WorkflowRunsList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get org-level workflow runs", @@ -13846,8 +13617,8 @@ "200": { "$ref": "#/components/responses/SecretList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List an organization's actions secrets", @@ -13883,11 +13654,8 @@ "204": { "description": "delete one secret of the organization" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Delete a secret in an organization", @@ -13934,11 +13702,8 @@ "204": { "description": "response when updating a secret" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Create or Update a secret value in an organization", @@ -13981,11 +13746,8 @@ "200": { "$ref": "#/components/responses/VariableList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get an org-level variables list", @@ -14027,11 +13789,8 @@ "204": { "description": "response when deleting a variable" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Delete an org-level variable", @@ -14065,11 +13824,8 @@ "200": { "$ref": "#/components/responses/ActionVariable" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get an org-level variable", @@ -14113,13 +13869,7 @@ "201": { "description": "successfully created the org-level variable" }, - "400": { - "$ref": "#/components/responses/error" - }, - "409": { - "description": "variable name already exists." - }, - "500": { + "default": { "$ref": "#/components/responses/error" } }, @@ -14167,11 +13917,8 @@ "204": { "description": "response when updating an org-level variable" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Update an org-level variable", @@ -14223,8 +13970,8 @@ "200": { "$ref": "#/components/responses/ActivityFeedsList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List an organization's activity feeds", @@ -14251,8 +13998,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete Avatar", @@ -14287,8 +14034,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Update Avatar", @@ -14365,11 +14112,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Unblock a user", @@ -14403,8 +14147,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Check if a user is blocked by the organization", @@ -14446,11 +14190,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Block a user", @@ -14493,8 +14234,8 @@ "200": { "$ref": "#/components/responses/HookList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List an organization's webhooks", @@ -14530,8 +14271,8 @@ "201": { "$ref": "#/components/responses/Hook" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a hook", @@ -14568,8 +14309,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a hook", @@ -14604,8 +14345,8 @@ "200": { "$ref": "#/components/responses/Hook" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a hook", @@ -14650,8 +14391,8 @@ "200": { "$ref": "#/components/responses/Hook" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Update a hook", @@ -14694,8 +14435,8 @@ "200": { "$ref": "#/components/responses/LabelList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List an organization's labels", @@ -14730,11 +14471,8 @@ "201": { "$ref": "#/components/responses/Label" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a label for an organization", @@ -14771,8 +14509,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a label", @@ -14807,8 +14545,8 @@ "200": { "$ref": "#/components/responses/Label" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a single label", @@ -14853,11 +14591,8 @@ "200": { "$ref": "#/components/responses/Label" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Update a label", @@ -14900,8 +14635,8 @@ "200": { "$ref": "#/components/responses/UserList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List an organization's members", @@ -14937,8 +14672,8 @@ "204": { "description": "member removed" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Remove a member from an organization", @@ -14975,8 +14710,8 @@ "303": { "description": "redirection to /orgs/{org}/public_members/{username}" }, - "404": { - "description": "user is not a member" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Check if a user is a member of an organization", @@ -15033,8 +14768,8 @@ "200": { "$ref": "#/components/responses/ProjectList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List an organization's projects", @@ -15069,11 +14804,8 @@ "201": { "$ref": "#/components/responses/Project" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a project owned by an organization", @@ -15110,8 +14842,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a project", @@ -15146,8 +14878,8 @@ "200": { "$ref": "#/components/responses/Project" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a project", @@ -15192,11 +14924,8 @@ "200": { "$ref": "#/components/responses/Project" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Edit a project", @@ -15249,8 +14978,8 @@ "200": { "$ref": "#/components/responses/ProjectColumnList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a project's columns", @@ -15295,14 +15024,8 @@ "201": { "$ref": "#/components/responses/ProjectColumn" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a column in a project", @@ -15350,14 +15073,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Reorder a project's columns", @@ -15405,14 +15122,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a project column", @@ -15457,8 +15168,8 @@ "200": { "$ref": "#/components/responses/ProjectColumn" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a project column", @@ -15513,14 +15224,8 @@ "200": { "$ref": "#/components/responses/ProjectColumn" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Edit a project column", @@ -15568,11 +15273,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Set a project's default column", @@ -15635,8 +15337,8 @@ "200": { "$ref": "#/components/responses/IssueList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List the issues in a project column", @@ -15693,14 +15395,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Remove an issue from a project column", @@ -15756,17 +15452,8 @@ "201": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Add an issue to a project column", @@ -15823,17 +15510,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Move an issue between a project's columns", @@ -15886,8 +15564,8 @@ "200": { "$ref": "#/components/responses/ProjectWorkflowList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a project's workflows", @@ -15932,14 +15610,8 @@ "201": { "$ref": "#/components/responses/ProjectWorkflow" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a project workflow", @@ -15986,11 +15658,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a project workflow", @@ -16035,8 +15704,8 @@ "200": { "$ref": "#/components/responses/ProjectWorkflow" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a project workflow", @@ -16091,14 +15760,8 @@ "200": { "$ref": "#/components/responses/ProjectWorkflow" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Edit a project workflow", @@ -16141,8 +15804,8 @@ "200": { "$ref": "#/components/responses/UserList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List an organization's public members", @@ -16178,11 +15841,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Conceal a user's membership", @@ -16216,8 +15876,8 @@ "204": { "description": "user is a public member" }, - "404": { - "description": "user is not a public member" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Check if a user is a public member of an organization", @@ -16251,11 +15911,8 @@ "204": { "description": "membership publicized" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Publicize a user's membership", @@ -16293,11 +15950,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Rename an organization", @@ -16327,11 +15981,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete all repositories in an organization", @@ -16372,8 +16023,8 @@ "200": { "$ref": "#/components/responses/RepositoryList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List an organization's repos", @@ -16408,14 +16059,8 @@ "201": { "$ref": "#/components/responses/Repository" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Create a repository in an organization", @@ -16458,8 +16103,8 @@ "200": { "$ref": "#/components/responses/TeamList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List an organization's teams", @@ -16494,11 +16139,8 @@ "201": { "$ref": "#/components/responses/Team" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a team", @@ -16575,8 +16217,8 @@ }, "description": "SearchResults of a successful search" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Search for teams within an organization", @@ -16659,8 +16301,8 @@ "200": { "$ref": "#/components/responses/PackageList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Gets all packages of an owner", @@ -16705,8 +16347,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a package", @@ -16765,8 +16407,8 @@ "200": { "$ref": "#/components/responses/PackageList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Gets all versions of a package", @@ -16811,8 +16453,8 @@ "200": { "$ref": "#/components/responses/Package" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Gets the latest version of a package", @@ -16866,8 +16508,8 @@ "201": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Link a package to a repository", @@ -16912,8 +16554,8 @@ "201": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Unlink a package from a repository", @@ -16967,8 +16609,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a package version", @@ -17020,8 +16662,8 @@ "200": { "$ref": "#/components/responses/Package" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Gets a package", @@ -17075,8 +16717,8 @@ "200": { "$ref": "#/components/responses/PackageFileList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Gets all files of a package", @@ -17250,11 +16892,8 @@ "200": { "$ref": "#/components/responses/IssueList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Search for issues across the repositories that the user has access to", @@ -17280,14 +16919,8 @@ "201": { "$ref": "#/components/responses/Repository" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "409": { - "description": "The repository with the same name already exists." - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Migrate a remote git repository", @@ -17445,8 +17078,8 @@ "200": { "$ref": "#/components/responses/SearchResults" }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Search for repositories", @@ -17482,11 +17115,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a repository", @@ -17520,8 +17150,8 @@ "200": { "$ref": "#/components/responses/Repository" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a repository", @@ -17566,14 +17196,8 @@ "200": { "$ref": "#/components/responses/Repository" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Edit a repository's properties. Only fields that are set will be changed.", @@ -17617,11 +17241,8 @@ "200": { "$ref": "#/components/responses/ArtifactsList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Lists all artifacts for a repository", @@ -17666,11 +17287,8 @@ "204": { "description": "No Content" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Deletes a specific artifact for a workflow run", @@ -17713,11 +17331,8 @@ "200": { "$ref": "#/components/responses/Artifact" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Gets a specific artifact for a workflow run", @@ -17762,11 +17377,8 @@ "302": { "description": "redirect to the blob download" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Downloads a specific artifact for a workflow run redirects to blob url", @@ -17842,14 +17454,8 @@ "200": { "$ref": "#/components/responses/WorkflowJobsList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Lists all jobs for a repository", @@ -17894,11 +17500,8 @@ "200": { "$ref": "#/components/responses/WorkflowJob" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Gets a specific workflow job for a workflow run", @@ -17943,11 +17546,8 @@ "200": { "description": "output blob content" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Downloads the job logs for a workflow run", @@ -17991,11 +17591,8 @@ "200": { "$ref": "#/components/responses/RunnerList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get repo-level runners", @@ -18074,11 +17671,8 @@ "204": { "description": "runner has been deleted" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Delete a repo-level runner", @@ -18121,11 +17715,8 @@ "200": { "$ref": "#/components/responses/Runner" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get a repo-level runner", @@ -18178,14 +17769,8 @@ "200": { "$ref": "#/components/responses/Runner" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Update a repo-level runner", @@ -18285,11 +17870,8 @@ "200": { "$ref": "#/components/responses/WorkflowRunsList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Lists all runs for a repository run", @@ -18334,11 +17916,8 @@ "204": { "description": "No Content" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Delete a workflow run", @@ -18381,11 +17960,8 @@ "200": { "$ref": "#/components/responses/WorkflowRun" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Gets a specific workflow run", @@ -18430,17 +18006,8 @@ "200": { "$ref": "#/components/responses/WorkflowRun" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { - "$ref": "#/components/responses/conflict" } }, "summary": "Approve a workflow run that requires approval", @@ -18493,11 +18060,8 @@ "200": { "$ref": "#/components/responses/ArtifactsList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Lists all artifacts for a repository run", @@ -18551,11 +18115,8 @@ "200": { "$ref": "#/components/responses/WorkflowRun" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Gets a specific workflow run attempt", @@ -18633,11 +18194,8 @@ "200": { "$ref": "#/components/responses/WorkflowJobsList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Lists all jobs for a workflow run attempt", @@ -18682,17 +18240,8 @@ "200": { "$ref": "#/components/responses/WorkflowRun" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { - "$ref": "#/components/responses/conflict" } }, "summary": "Cancel a workflow run and its jobs", @@ -18738,17 +18287,8 @@ "200": { "$ref": "#/components/responses/WorkflowRun" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { - "$ref": "#/components/responses/conflict" } }, "summary": "Force-cancel a workflow run", @@ -18833,14 +18373,8 @@ "200": { "$ref": "#/components/responses/WorkflowJobsList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Lists all jobs for a workflow run", @@ -18894,20 +18428,8 @@ "201": { "$ref": "#/components/responses/WorkflowJob" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { - "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Reruns a specific workflow job in a run", @@ -18952,8 +18474,8 @@ "200": { "description": "Logs archive" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Download workflow run logs as archive", @@ -18998,20 +18520,8 @@ "201": { "$ref": "#/components/responses/WorkflowRun" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { - "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Reruns an entire workflow run", @@ -19056,20 +18566,8 @@ "201": { "$ref": "#/components/responses/empty" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { - "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Reruns all failed jobs in a workflow run", @@ -19121,8 +18619,8 @@ "200": { "$ref": "#/components/responses/SecretList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a repo's actions secrets", @@ -19167,11 +18665,8 @@ "204": { "description": "delete one secret of the repository" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Delete a secret in a repository", @@ -19227,11 +18722,8 @@ "204": { "description": "response when updating a secret" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Create or Update a secret value in a repository", @@ -19283,20 +18775,8 @@ "200": { "$ref": "#/components/responses/TasksList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { - "$ref": "#/components/responses/conflict" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "List a repository's action tasks", @@ -19348,11 +18828,8 @@ "200": { "$ref": "#/components/responses/VariableList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get repo-level variables list", @@ -19403,11 +18880,8 @@ "204": { "description": "response when deleting a variable" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Delete a repo-level variable", @@ -19450,11 +18924,8 @@ "200": { "$ref": "#/components/responses/ActionVariable" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get a repo-level variable", @@ -19507,13 +18978,7 @@ "201": { "description": "response when creating a repo-level variable" }, - "400": { - "$ref": "#/components/responses/error" - }, - "409": { - "description": "variable name already exists." - }, - "500": { + "default": { "$ref": "#/components/responses/error" } }, @@ -19570,11 +19035,8 @@ "204": { "description": "response when updating a repo-level variable" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Update a repo-level variable", @@ -19610,19 +19072,7 @@ "200": { "$ref": "#/components/responses/ActionWorkflowList" }, - "400": { - "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "500": { + "default": { "$ref": "#/components/responses/error" } }, @@ -19668,19 +19118,7 @@ "200": { "$ref": "#/components/responses/ActionWorkflow" }, - "400": { - "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "500": { + "default": { "$ref": "#/components/responses/error" } }, @@ -19726,17 +19164,8 @@ "204": { "description": "No Content" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Disable a workflow", @@ -19811,17 +19240,8 @@ "204": { "description": "No Content, if return_run_details is missing or false" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Create a workflow dispatch event", @@ -19866,20 +19286,8 @@ "204": { "description": "No Content" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { - "$ref": "#/components/responses/conflict" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Enable a workflow", @@ -19997,14 +19405,8 @@ "200": { "$ref": "#/components/responses/WorkflowRunsList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "List runs for a workflow", @@ -20065,8 +19467,8 @@ "200": { "$ref": "#/components/responses/ActivityFeedsList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a repository's activity feeds", @@ -20124,8 +19526,8 @@ "200": { "description": "success" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get an archive of a repository", @@ -20161,8 +19563,8 @@ "200": { "$ref": "#/components/responses/UserList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Return all users that have write access and can be assigned to issues", @@ -20207,11 +19609,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Check if a user can be assigned to issues in a repository", @@ -20247,8 +19646,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete avatar", @@ -20292,8 +19691,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Update avatar", @@ -20371,17 +19770,8 @@ "201": { "$ref": "#/components/responses/BranchProtection" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a branch protections for a repository", @@ -20427,14 +19817,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Update the priorities of branch protections for a repository.", @@ -20479,8 +19863,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a specific branch protection for the repository", @@ -20523,8 +19907,8 @@ "200": { "$ref": "#/components/responses/BranchProtection" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a specific branch protection for the repository", @@ -20577,14 +19961,8 @@ "200": { "$ref": "#/components/responses/BranchProtection" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Edit a branch protections for a repository. Only fields that are set will be changed", @@ -20686,17 +20064,8 @@ "201": { "$ref": "#/components/responses/Branch" }, - "403": { - "description": "The branch is archived or a mirror." - }, - "404": { - "description": "The old branch does not exist." - }, - "409": { - "description": "The branch with the same name already exists." - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a branch", @@ -20741,14 +20110,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" } }, "summary": "Delete a specific branch from a repository", @@ -20791,8 +20154,8 @@ "200": { "$ref": "#/components/responses/Branch" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Retrieve a specific branch from a repository, including its effective branch protection", @@ -20845,14 +20208,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Rename a branch", @@ -20905,17 +20262,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { - "$ref": "#/components/responses/conflict" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Update a branch reference to a new commit", @@ -20967,8 +20315,8 @@ "200": { "$ref": "#/components/responses/UserList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a repository's collaborators", @@ -21013,11 +20361,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a collaborator from a repository", @@ -21060,11 +20405,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Check if a user is a collaborator of a repository", @@ -21117,14 +20459,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Add or Update a collaborator to a repository", @@ -21169,11 +20505,8 @@ "200": { "$ref": "#/components/responses/RepoCollaboratorPermission" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get repository permissions for a user", @@ -21291,11 +20624,8 @@ "200": { "$ref": "#/components/responses/CommitList" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { - "$ref": "#/components/responses/EmptyRepository" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a list of all commits from a repository", @@ -21356,11 +20686,8 @@ "200": { "$ref": "#/components/responses/CombinedStatus" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get a commit's combined status, by branch/tag/commit reference", @@ -21451,11 +20778,8 @@ "200": { "$ref": "#/components/responses/CommitStatusList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get a commit's statuses, by branch/tag/commit reference", @@ -21500,8 +20824,8 @@ "200": { "$ref": "#/components/responses/PullRequest" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get the merged pull request of the commit", @@ -21575,11 +20899,8 @@ "200": { "$ref": "#/components/responses/Compare" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get commit comparison information", @@ -21624,8 +20945,8 @@ "200": { "$ref": "#/components/responses/ContentsListResponse" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Gets the metadata of all the entries of the root dir.", @@ -21670,17 +20991,8 @@ "201": { "$ref": "#/components/responses/FilesResponse" }, - "403": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/error" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" } }, "summary": "Modify multiple files in a repository", @@ -21742,8 +21054,8 @@ "200": { "$ref": "#/components/responses/ContentsExtResponse" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "The extended \"contents\" API, to get file metadata and/or content, or list a directory.", @@ -21799,20 +21111,8 @@ "200": { "$ref": "#/components/responses/FileDeleteResponse" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/error" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" } }, "summary": "Delete a file in a repository", @@ -21864,8 +21164,8 @@ "200": { "$ref": "#/components/responses/ContentsResponse" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Gets the metadata and contents (if a file) of an entry in a repository, or a list of entries if a dir.", @@ -21919,17 +21219,8 @@ "201": { "$ref": "#/components/responses/FileResponse" }, - "403": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/error" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" } }, "summary": "Create a file in a repository", @@ -21986,17 +21277,8 @@ "201": { "$ref": "#/components/responses/FileResponse" }, - "403": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/error" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" } }, "summary": "Update a file in a repository if SHA is set, or create the file if SHA is not set", @@ -22043,11 +21325,8 @@ "200": { "$ref": "#/components/responses/FileResponse" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Apply diff patch to repository", @@ -22100,8 +21379,8 @@ "200": { "description": "success" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get the EditorConfig definitions of a file in a repository", @@ -22155,8 +21434,8 @@ "200": { "$ref": "#/components/responses/ContentsListResponse" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get the metadata and contents of requested files", @@ -22210,8 +21489,8 @@ "200": { "$ref": "#/components/responses/ContentsListResponse" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get the metadata and contents of requested files", @@ -22263,8 +21542,8 @@ "200": { "$ref": "#/components/responses/RepositoryList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a repository's forks", @@ -22308,17 +21587,8 @@ "202": { "$ref": "#/components/responses/Repository" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { - "description": "The repository with the same name already exists." - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Fork a repository", @@ -22363,11 +21633,8 @@ "200": { "$ref": "#/components/responses/GitBlobResponse" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Gets the blob of a repository.", @@ -22436,11 +21703,8 @@ "200": { "$ref": "#/components/responses/Commit" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a single commit from a repository, it has a GitHub-compatible alias \"/repos/{owner}/{repo}/commits/{ref}\"", @@ -22498,8 +21762,8 @@ "200": { "$ref": "#/components/responses/string" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a commit's diff or patch", @@ -22560,11 +21824,8 @@ "200": { "$ref": "#/components/responses/Note" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a note corresponding to a single commit from a repository", @@ -22600,8 +21861,8 @@ "200": { "$ref": "#/components/responses/ReferenceList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get specified ref or filtered repository's refs", @@ -22646,8 +21907,8 @@ "200": { "$ref": "#/components/responses/ReferenceList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get specified ref or filtered repository's refs", @@ -22692,11 +21953,8 @@ "200": { "$ref": "#/components/responses/AnnotatedTag" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Gets the tag object of an annotated tag (not lightweight tags)", @@ -22765,11 +22023,8 @@ "200": { "$ref": "#/components/responses/GitTreeResponse" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Gets the tree of a repository.", @@ -22821,8 +22076,8 @@ "200": { "$ref": "#/components/responses/HookList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List the hooks in a repository", @@ -22866,8 +22121,8 @@ "201": { "$ref": "#/components/responses/Hook" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a hook", @@ -22903,8 +22158,8 @@ "200": { "$ref": "#/components/responses/GitHookList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List the Git hooks in a repository", @@ -22949,8 +22204,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a Git hook in a repository", @@ -22993,8 +22248,8 @@ "200": { "$ref": "#/components/responses/GitHook" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a Git hook", @@ -23047,8 +22302,8 @@ "200": { "$ref": "#/components/responses/GitHook" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Edit a Git hook in a repository", @@ -23094,8 +22349,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a hook in a repository", @@ -23139,8 +22394,8 @@ "200": { "$ref": "#/components/responses/Hook" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a hook", @@ -23194,8 +22449,8 @@ "200": { "$ref": "#/components/responses/Hook" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Edit a hook in a repository", @@ -23257,8 +22512,8 @@ "200": { "$ref": "#/components/responses/HookDeliveryList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List the deliveries of a hook in a repository", @@ -23313,8 +22568,8 @@ "200": { "$ref": "#/components/responses/HookDelivery" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a delivery of a hook in a repository", @@ -23368,8 +22623,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Test a push webhook", @@ -23405,8 +22660,8 @@ "200": { "$ref": "#/components/responses/RepoIssueConfig" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Returns the issue config for a repo", @@ -23442,8 +22697,8 @@ "200": { "$ref": "#/components/responses/RepoIssueConfigValidation" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Returns the validation information for a issue config", @@ -23479,8 +22734,8 @@ "200": { "$ref": "#/components/responses/IssueTemplates" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get available issue templates for a repository", @@ -23623,8 +22878,8 @@ "200": { "$ref": "#/components/responses/IssueList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a repository's issues", @@ -23668,20 +22923,8 @@ "201": { "$ref": "#/components/responses/Issue" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "412": { + "default": { "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" } }, "summary": "Create an issue. If using deadline only the date will be taken into account, and time of day ignored.", @@ -23751,8 +22994,8 @@ "200": { "$ref": "#/components/responses/CommentList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List all comments in a repository", @@ -23798,11 +23041,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a comment", @@ -23849,11 +23089,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a comment", @@ -23910,14 +23147,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Edit a comment", @@ -23963,7 +23194,7 @@ "200": { "$ref": "#/components/responses/AttachmentList" }, - "404": { + "default": { "$ref": "#/components/responses/error" } }, @@ -24036,23 +23267,8 @@ "201": { "$ref": "#/components/responses/Attachment" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/error" - }, - "413": { - "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" } }, "summary": "Create a comment attachment", @@ -24108,11 +23324,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { + "default": { "$ref": "#/components/responses/error" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" } }, "summary": "Delete a comment attachment", @@ -24166,7 +23379,7 @@ "200": { "$ref": "#/components/responses/Attachment" }, - "404": { + "default": { "$ref": "#/components/responses/error" } }, @@ -24231,14 +23444,8 @@ "201": { "$ref": "#/components/responses/Attachment" }, - "404": { + "default": { "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" } }, "summary": "Edit a comment attachment", @@ -24294,11 +23501,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Remove a reaction from a comment of an issue", @@ -24342,11 +23546,8 @@ "200": { "$ref": "#/components/responses/ReactionList" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a list of reactions from a comment of an issue", @@ -24403,11 +23604,8 @@ "201": { "$ref": "#/components/responses/Reaction" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Add a reaction to a comment of an issue", @@ -24443,8 +23641,8 @@ "200": { "$ref": "#/components/responses/IssueList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a repo's pinned issues", @@ -24490,14 +23688,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete an issue", @@ -24541,8 +23733,8 @@ "200": { "$ref": "#/components/responses/Issue" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get an issue", @@ -24597,17 +23789,8 @@ "201": { "$ref": "#/components/responses/Issue" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "412": { + "default": { "$ref": "#/components/responses/error" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" } }, "summary": "Edit an issue. If using deadline only the date will be taken into account, and time of day ignored.", @@ -24653,7 +23836,7 @@ "200": { "$ref": "#/components/responses/AttachmentList" }, - "404": { + "default": { "$ref": "#/components/responses/error" } }, @@ -24726,20 +23909,8 @@ "201": { "$ref": "#/components/responses/Attachment" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/error" - }, - "413": { - "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" } }, "summary": "Create an issue attachment", @@ -24795,11 +23966,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { + "default": { "$ref": "#/components/responses/error" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" } }, "summary": "Delete an issue attachment", @@ -24853,7 +24021,7 @@ "200": { "$ref": "#/components/responses/Attachment" }, - "404": { + "default": { "$ref": "#/components/responses/error" } }, @@ -24918,14 +24086,8 @@ "201": { "$ref": "#/components/responses/Attachment" }, - "404": { + "default": { "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" } }, "summary": "Edit an issue attachment", @@ -24982,14 +24144,8 @@ "200": { "$ref": "#/components/responses/Issue" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Remove assignees from an issue", @@ -25044,17 +24200,8 @@ "201": { "$ref": "#/components/responses/Issue" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Add assignees to an issue", @@ -25109,11 +24256,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Check if a user can be assigned to an issue", @@ -25168,8 +24312,8 @@ "200": { "$ref": "#/components/responses/Issue" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Unblock the issue given in the body by the issue in path", @@ -25228,8 +24372,8 @@ "200": { "$ref": "#/components/responses/IssueList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List issues that are blocked by this issue", @@ -25282,8 +24426,8 @@ "201": { "$ref": "#/components/responses/Issue" }, - "404": { - "description": "the issue does not exist" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Block the issue given in the body by the issue in path", @@ -25347,8 +24491,8 @@ "200": { "$ref": "#/components/responses/CommentList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List all comments on an issue", @@ -25402,14 +24546,8 @@ "201": { "$ref": "#/components/responses/Comment" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Add a comment to an issue", @@ -25465,11 +24603,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a comment", @@ -25536,11 +24671,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Edit a comment", @@ -25596,11 +24728,8 @@ "201": { "$ref": "#/components/responses/IssueDeadline" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Set an issue deadline. If set to null, the deadline is deleted. If using deadline only the date will be taken into account, and time of day ignored.", @@ -25655,11 +24784,8 @@ "200": { "$ref": "#/components/responses/Issue" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Remove an issue dependency", @@ -25718,8 +24844,8 @@ "200": { "$ref": "#/components/responses/IssueList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List an issue's dependencies, i.e all issues that block this issue.", @@ -25772,11 +24898,8 @@ "201": { "$ref": "#/components/responses/Issue" }, - "404": { - "description": "the issue does not exist" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Make the issue in the url depend on the issue in the form.", @@ -25822,14 +24945,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Remove all labels from an issue", @@ -25873,8 +24990,8 @@ "200": { "$ref": "#/components/responses/LabelList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get an issue's labels", @@ -25928,14 +25045,8 @@ "200": { "$ref": "#/components/responses/LabelList" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Add a label to an issue", @@ -25989,14 +25100,8 @@ "200": { "$ref": "#/components/responses/LabelList" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Replace an issue's labels", @@ -26052,17 +25157,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Remove a label from an issue", @@ -26108,11 +25204,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Unlock an issue", @@ -26166,11 +25259,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Lock an issue", @@ -26216,11 +25306,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Unpin an Issue", @@ -26264,11 +25351,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Pin an Issue", @@ -26324,11 +25408,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Moves the Pin to the given Position", @@ -26384,11 +25465,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Remove a reaction from an issue", @@ -26448,11 +25526,8 @@ "200": { "$ref": "#/components/responses/ReactionList" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a list reactions of an issue", @@ -26509,11 +25584,8 @@ "201": { "$ref": "#/components/responses/Reaction" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Add a reaction to an issue", @@ -26559,14 +25631,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "description": "Not repo writer, user does not have rights to toggle stopwatch" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { - "description": "Cannot cancel a non-existent stopwatch" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete an issue's existing stopwatch.", @@ -26612,14 +25678,8 @@ "201": { "$ref": "#/components/responses/empty" }, - "403": { - "description": "Not repo writer, user does not have rights to toggle stopwatch" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { - "description": "Cannot start a stopwatch again if it already exists" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Start stopwatch on an issue.", @@ -26665,14 +25725,8 @@ "201": { "$ref": "#/components/responses/empty" }, - "403": { - "description": "Not repo writer, user does not have rights to toggle stopwatch" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { - "description": "Cannot stop a non-existent stopwatch" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Stop an issue's existing stopwatch.", @@ -26734,8 +25788,8 @@ "200": { "$ref": "#/components/responses/UserList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get users who subscribed on an issue.", @@ -26781,8 +25835,8 @@ "200": { "$ref": "#/components/responses/WatchInfo" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Check if user is subscribed to an issue", @@ -26843,8 +25897,8 @@ "304": { "description": "User can only subscribe itself if he is no admin" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Unsubscribe user from issue", @@ -26903,8 +25957,8 @@ "304": { "description": "User can only subscribe itself if he is no admin" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Subscribe user to issue", @@ -26984,8 +26038,8 @@ "200": { "$ref": "#/components/responses/TimelineList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List all comments and events on an issue", @@ -27031,14 +26085,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Reset a tracked time of an issue", @@ -27124,8 +26172,8 @@ "200": { "$ref": "#/components/responses/TrackedTimeList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List an issue's tracked times", @@ -27179,14 +26227,8 @@ "200": { "$ref": "#/components/responses/TrackedTime" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Add tracked time to a issue", @@ -27242,14 +26284,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Delete specific tracked time", @@ -27317,8 +26353,8 @@ "200": { "$ref": "#/components/responses/DeployKeyList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a repository's keys", @@ -27362,11 +26398,8 @@ "201": { "$ref": "#/components/responses/DeployKey" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Add a key to a repository", @@ -27412,11 +26445,8 @@ "201": { "$ref": "#/components/responses/DeployKey" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Add a deploy token to a repository, it authenticates git over HTTPS", @@ -27462,11 +26492,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a key from a repository", @@ -27510,8 +26537,8 @@ "200": { "$ref": "#/components/responses/DeployKey" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a repository's key by id", @@ -27563,8 +26590,8 @@ "200": { "$ref": "#/components/responses/LabelList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get all of a repository's labels", @@ -27608,11 +26635,8 @@ "201": { "$ref": "#/components/responses/Label" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a label", @@ -27658,8 +26682,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a label", @@ -27703,8 +26727,8 @@ "200": { "$ref": "#/components/responses/Label" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a single label", @@ -27758,11 +26782,8 @@ "200": { "$ref": "#/components/responses/Label" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Update a label", @@ -27798,8 +26819,8 @@ "200": { "$ref": "#/components/responses/LanguageStatistics" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get languages and number of bytes of code written", @@ -27835,8 +26856,8 @@ "200": { "$ref": "#/components/responses/LicensesList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get repo licenses", @@ -27897,8 +26918,8 @@ }, "description": "Returns raw file content." }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a file or it's LFS object from a repository", @@ -27944,13 +26965,7 @@ "200": { "$ref": "#/components/responses/MergeUpstreamResponse" }, - "400": { - "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { + "default": { "$ref": "#/components/responses/error" } }, @@ -28019,8 +27034,8 @@ "200": { "$ref": "#/components/responses/MilestoneList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get all of a repository's opened milestones", @@ -28064,8 +27079,8 @@ "201": { "$ref": "#/components/responses/Milestone" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a milestone", @@ -28110,8 +27125,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a milestone", @@ -28154,8 +27169,8 @@ "200": { "$ref": "#/components/responses/Milestone" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a milestone", @@ -28208,8 +27223,8 @@ "200": { "$ref": "#/components/responses/Milestone" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Update a milestone", @@ -28245,11 +27260,8 @@ "200": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Sync a mirrored repository", @@ -28285,8 +27297,8 @@ "200": { "$ref": "#/components/responses/RepoNewIssuePinsAllowed" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Returns if new Issue Pins are allowed", @@ -28530,8 +27542,8 @@ "200": { "$ref": "#/components/responses/ProjectList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a repository's projects", @@ -28575,14 +27587,8 @@ "201": { "$ref": "#/components/responses/Project" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a project owned by a repository", @@ -28628,11 +27634,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a project", @@ -28676,8 +27679,8 @@ "200": { "$ref": "#/components/responses/Project" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a project", @@ -28731,14 +27734,8 @@ "200": { "$ref": "#/components/responses/Project" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Edit a project", @@ -28800,8 +27797,8 @@ "200": { "$ref": "#/components/responses/ProjectColumnList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a project's columns", @@ -28855,17 +27852,8 @@ "201": { "$ref": "#/components/responses/ProjectColumn" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a column in a project", @@ -28922,17 +27910,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Reorder a project's columns", @@ -28989,17 +27968,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a project column", @@ -29053,8 +28023,8 @@ "200": { "$ref": "#/components/responses/ProjectColumn" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a project column", @@ -29118,17 +28088,8 @@ "200": { "$ref": "#/components/responses/ProjectColumn" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Edit a project column", @@ -29185,14 +28146,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Set a project's default column", @@ -29264,8 +28219,8 @@ "200": { "$ref": "#/components/responses/IssueList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List the issues in a project column", @@ -29331,14 +28286,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Remove an issue from a project column", @@ -29403,17 +28352,8 @@ "201": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Add an issue to a project column", @@ -29479,17 +28419,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Move an issue between a project's columns", @@ -29551,8 +28482,8 @@ "200": { "$ref": "#/components/responses/ProjectWorkflowList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a project's workflows", @@ -29606,17 +28537,8 @@ "201": { "$ref": "#/components/responses/ProjectWorkflow" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a project workflow", @@ -29672,14 +28594,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a project workflow", @@ -29733,8 +28649,8 @@ "200": { "$ref": "#/components/responses/ProjectWorkflow" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a project workflow", @@ -29798,17 +28714,8 @@ "200": { "$ref": "#/components/responses/ProjectWorkflow" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Edit a project workflow", @@ -29933,10 +28840,7 @@ "200": { "$ref": "#/components/responses/PullRequestList" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "500": { + "default": { "$ref": "#/components/responses/error" } }, @@ -29981,20 +28885,8 @@ "201": { "$ref": "#/components/responses/PullRequest" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { + "default": { "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" } }, "summary": "Create a pull request", @@ -30040,14 +28932,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "400": { - "$ref": "#/components/responses/validationError" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Resolve a pull request review comment", @@ -30093,14 +28979,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "400": { - "$ref": "#/components/responses/validationError" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Unresolve a pull request review comment", @@ -30136,8 +29016,8 @@ "200": { "$ref": "#/components/responses/PullRequestList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a repo's pinned pull requests", @@ -30191,8 +29071,8 @@ "200": { "$ref": "#/components/responses/PullRequest" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a pull request by base and head", @@ -30238,8 +29118,8 @@ "200": { "$ref": "#/components/responses/PullRequest" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a pull request", @@ -30293,23 +29173,8 @@ "201": { "$ref": "#/components/responses/PullRequest" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { - "$ref": "#/components/responses/error" - }, - "412": { - "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Update a pull request. If using deadline only the date will be taken into account, and time of day ignored.", @@ -30376,8 +29241,8 @@ "200": { "$ref": "#/components/responses/string" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a pull request diff or patch", @@ -30444,14 +29309,8 @@ "201": { "$ref": "#/components/responses/PullReviewComment" }, - "400": { - "$ref": "#/components/responses/validationError" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Reply to a pull request review comment", @@ -30529,8 +29388,8 @@ "200": { "$ref": "#/components/responses/CommitList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get commits for a pull request", @@ -30614,8 +29473,8 @@ "200": { "$ref": "#/components/responses/ChangedFileList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get changed files for a pull request", @@ -30661,14 +29520,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Cancel the scheduled auto merge for the given pull request", @@ -30712,8 +29565,8 @@ "204": { "description": "pull request has been merged" }, - "404": { - "description": "pull request has not been merged" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Check if a pull request has been merged", @@ -30767,20 +29620,8 @@ "200": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "405": { - "$ref": "#/components/responses/empty" - }, - "409": { + "default": { "$ref": "#/components/responses/error" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" } }, "summary": "Merge a pull request", @@ -30837,14 +29678,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "cancel review requests for a pull request", @@ -30899,11 +29734,8 @@ "201": { "$ref": "#/components/responses/PullReviewList" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "create review requests for a pull request", @@ -30965,8 +29797,8 @@ "200": { "$ref": "#/components/responses/PullReviewList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List all reviews for a pull request", @@ -31021,11 +29853,8 @@ "200": { "$ref": "#/components/responses/PullReview" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a review to a pull request", @@ -31081,11 +29910,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a specific review from a pull request", @@ -31139,8 +29965,8 @@ "200": { "$ref": "#/components/responses/PullReview" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a specific review for a pull request", @@ -31205,11 +30031,8 @@ "200": { "$ref": "#/components/responses/PullReview" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Submit a pending review to a pull request", @@ -31265,8 +30088,8 @@ "200": { "$ref": "#/components/responses/PullReviewCommentList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a specific review for a pull request", @@ -31333,14 +30156,8 @@ "200": { "$ref": "#/components/responses/PullReview" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Dismiss a review for a pull request", @@ -31396,14 +30213,8 @@ "200": { "$ref": "#/components/responses/PullReview" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Cancel to dismiss a review for a pull request", @@ -31461,17 +30272,8 @@ "200": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { + "default": { "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Merge PR's baseBranch into headBranch", @@ -31523,14 +30325,8 @@ "200": { "$ref": "#/components/responses/PushMirrorList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get all push mirrors of the repository", @@ -31574,14 +30370,8 @@ "200": { "$ref": "#/components/responses/PushMirror" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "add a push mirror to the repository", @@ -31617,17 +30407,8 @@ "200": { "$ref": "#/components/responses/empty" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Sync all push mirrored repository", @@ -31672,11 +30453,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "deletes a push mirror from a repository by remoteName", @@ -31719,14 +30497,8 @@ "200": { "$ref": "#/components/responses/PushMirror" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get push mirror of the repository by remoteName", @@ -31787,8 +30559,8 @@ }, "description": "Returns raw file content." }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a file from a repository", @@ -31864,8 +30636,8 @@ "200": { "$ref": "#/components/responses/ReleaseList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a repo's releases", @@ -31909,14 +30681,8 @@ "201": { "$ref": "#/components/responses/Release" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { + "default": { "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Create a release", @@ -31952,8 +30718,8 @@ "200": { "$ref": "#/components/responses/Release" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Gets the most recent non-prerelease, non-draft release of a repository, sorted by created_at", @@ -31998,11 +30764,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a release by tag name", @@ -32045,8 +30808,8 @@ "200": { "$ref": "#/components/responses/Release" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a release by tag name", @@ -32092,11 +30855,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a release", @@ -32140,8 +30900,8 @@ "200": { "$ref": "#/components/responses/Release" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a release", @@ -32195,8 +30955,8 @@ "200": { "$ref": "#/components/responses/Release" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Update a release", @@ -32242,8 +31002,8 @@ "200": { "$ref": "#/components/responses/AttachmentList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List release's attachments", @@ -32325,13 +31085,7 @@ "201": { "$ref": "#/components/responses/Attachment" }, - "400": { - "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "413": { + "default": { "$ref": "#/components/responses/error" } }, @@ -32388,8 +31142,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a release attachment", @@ -32443,8 +31197,8 @@ "200": { "$ref": "#/components/responses/Attachment" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a release attachment", @@ -32508,11 +31262,8 @@ "201": { "$ref": "#/components/responses/Attachment" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Edit a release attachment", @@ -32548,8 +31299,8 @@ "200": { "$ref": "#/components/responses/UserList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Return all users that can be requested to review in this repo", @@ -32683,11 +31434,8 @@ "200": { "$ref": "#/components/responses/UserList" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a repo's stargazers", @@ -32778,11 +31526,8 @@ "200": { "$ref": "#/components/responses/CommitStatusList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get a commit's statuses", @@ -32835,11 +31580,8 @@ "201": { "$ref": "#/components/responses/CommitStatus" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Create a commit status", @@ -32891,8 +31633,8 @@ "200": { "$ref": "#/components/responses/UserList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a repo's watchers", @@ -32928,8 +31670,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Unwatch a repo", @@ -32963,8 +31705,8 @@ "200": { "$ref": "#/components/responses/WatchInfo" }, - "404": { - "description": "User is not watching this repo or repo do not exist" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Check if the current user is watching a repo", @@ -32998,11 +31740,8 @@ "200": { "$ref": "#/components/responses/WatchInfo" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Watch a repo", @@ -33080,17 +31819,8 @@ "201": { "$ref": "#/components/responses/TagProtection" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a tag protections for a repository", @@ -33135,8 +31865,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a specific tag protection for the repository", @@ -33179,8 +31909,8 @@ "200": { "$ref": "#/components/responses/TagProtection" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a specific tag protection for the repository", @@ -33233,14 +31963,8 @@ "200": { "$ref": "#/components/responses/TagProtection" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Edit a tag protections for a repository. Only fields that are set will be changed", @@ -33292,8 +32016,8 @@ "200": { "$ref": "#/components/responses/TagList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a repository's tags", @@ -33337,20 +32061,8 @@ "200": { "$ref": "#/components/responses/Tag" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "405": { - "$ref": "#/components/responses/empty" - }, - "409": { - "$ref": "#/components/responses/conflict" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a new git tag in a repository", @@ -33395,20 +32107,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "405": { - "$ref": "#/components/responses/empty" - }, - "409": { - "$ref": "#/components/responses/conflict" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a repository's tag by name", @@ -33451,8 +32151,8 @@ "200": { "$ref": "#/components/responses/Tag" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get the tag of a repository by tag name", @@ -33488,8 +32188,8 @@ "200": { "$ref": "#/components/responses/TeamList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a repository's teams", @@ -33534,17 +32234,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "405": { + "default": { "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Delete a team from a repository", @@ -33587,10 +32278,7 @@ "200": { "$ref": "#/components/responses/Team" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "405": { + "default": { "$ref": "#/components/responses/error" } }, @@ -33634,17 +32322,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "405": { + "default": { "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Add a team to a repository", @@ -33722,14 +32401,8 @@ "200": { "$ref": "#/components/responses/TrackedTimeList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "List a repo's tracked times", @@ -33775,14 +32448,8 @@ "200": { "$ref": "#/components/responses/TrackedTimeList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "List a user's tracked times in a repo", @@ -33834,8 +32501,8 @@ "200": { "$ref": "#/components/responses/TopicNames" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get list of topics that a repository has", @@ -33879,14 +32546,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/invalidTopicsError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Replace list of topics for a repository", @@ -33931,14 +32592,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/invalidTopicsError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a topic from a repository", @@ -33981,14 +32636,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/invalidTopicsError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Add a topic to a repository", @@ -34036,14 +32685,8 @@ "202": { "$ref": "#/components/responses/Repository" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Transfer a repo ownership", @@ -34079,11 +32722,8 @@ "202": { "$ref": "#/components/responses/Repository" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Accept a repo transfer", @@ -34119,11 +32759,8 @@ "200": { "$ref": "#/components/responses/Repository" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Reject a repo transfer", @@ -34169,17 +32806,8 @@ "201": { "$ref": "#/components/responses/WikiPage" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" } }, "summary": "Create a wiki page", @@ -34224,14 +32852,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a wiki page", @@ -34274,8 +32896,8 @@ "200": { "$ref": "#/components/responses/WikiPage" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a wiki page", @@ -34328,17 +32950,8 @@ "200": { "$ref": "#/components/responses/WikiPage" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" } }, "summary": "Edit a wiki page", @@ -34390,8 +33003,8 @@ "200": { "$ref": "#/components/responses/WikiPageList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get all wiki pages", @@ -34444,8 +33057,8 @@ "200": { "$ref": "#/components/responses/WikiCommitList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get revisions of a wiki page", @@ -34491,17 +33104,8 @@ "201": { "$ref": "#/components/responses/Repository" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "409": { - "description": "The repository with the same name already exists." - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a repository using a template", @@ -34529,8 +33133,8 @@ "200": { "$ref": "#/components/responses/Repository" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a repository by id", @@ -34656,8 +33260,8 @@ "204": { "description": "team deleted" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a team", @@ -34683,8 +33287,8 @@ "200": { "$ref": "#/components/responses/Team" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a team", @@ -34719,8 +33323,8 @@ "200": { "$ref": "#/components/responses/Team" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Edit a team", @@ -34773,8 +33377,8 @@ "200": { "$ref": "#/components/responses/ActivityFeedsList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a team's activity feeds", @@ -34818,8 +33422,8 @@ "200": { "$ref": "#/components/responses/UserList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a team's members", @@ -34856,8 +33460,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Remove a team member", @@ -34892,8 +33496,8 @@ "200": { "$ref": "#/components/responses/User" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a particular member of team", @@ -34928,11 +33532,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Add a team member", @@ -34976,8 +33577,8 @@ "200": { "$ref": "#/components/responses/RepositoryList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a team's repos", @@ -35024,11 +33625,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Remove a repository from a team", @@ -35072,8 +33670,8 @@ "200": { "$ref": "#/components/responses/Repository" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a particular repo of team", @@ -35117,11 +33715,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Add a repository to a team", @@ -35190,11 +33785,8 @@ "200": { "$ref": "#/components/responses/TopicListResponse" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "search topics via keyword", @@ -35266,14 +33858,8 @@ "200": { "$ref": "#/components/responses/WorkflowJobsList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Get workflow jobs", @@ -35299,11 +33885,8 @@ "200": { "$ref": "#/components/responses/RunnerList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get user-level runners", @@ -35344,11 +33927,8 @@ "204": { "description": "runner has been deleted" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Delete a user-level runner", @@ -35373,11 +33953,8 @@ "200": { "$ref": "#/components/responses/Runner" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get a user-level runner", @@ -35412,14 +33989,8 @@ "200": { "$ref": "#/components/responses/Runner" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Update a user-level runner", @@ -35493,11 +34064,8 @@ "200": { "$ref": "#/components/responses/WorkflowRunsList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get workflow runs", @@ -35524,11 +34092,8 @@ "204": { "description": "delete one secret of the user" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Delete a secret in a user scope", @@ -35566,11 +34131,8 @@ "204": { "description": "response when updating a secret" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Create or Update a secret value in a user scope", @@ -35604,11 +34166,8 @@ "200": { "$ref": "#/components/responses/VariableList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get the user-level list of variables which is created by current doer", @@ -35638,11 +34197,8 @@ "204": { "description": "response when deleting a variable" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Delete a user-level variable which is created by current doer", @@ -35667,11 +34223,8 @@ "200": { "$ref": "#/components/responses/ActionVariable" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Get a user-level variable which is created by current doer", @@ -35706,11 +34259,8 @@ "201": { "description": "successfully created the user-level variable" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "409": { - "description": "variable name already exists." } }, "summary": "Create a user-level variable", @@ -35748,11 +34298,8 @@ "204": { "description": "response when updating a variable" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "Update a user-level variable which is created by current doer", @@ -35809,7 +34356,7 @@ "201": { "$ref": "#/components/responses/OAuth2Application" }, - "400": { + "default": { "$ref": "#/components/responses/error" } }, @@ -35838,8 +34385,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "delete an OAuth2 Application", @@ -35865,8 +34412,8 @@ "200": { "$ref": "#/components/responses/OAuth2Application" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "get an OAuth2 Application", @@ -35903,11 +34450,8 @@ "200": { "$ref": "#/components/responses/OAuth2Application" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "404": { - "$ref": "#/components/responses/notFound" } }, "summary": "update an OAuth2 Application, this includes regenerating the client secret", @@ -36002,11 +34546,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Unblock a user", @@ -36031,8 +34572,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Check if a user is blocked by the authenticated user", @@ -36065,11 +34606,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Block a user", @@ -36095,8 +34633,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete email addresses", @@ -36132,14 +34670,8 @@ "201": { "$ref": "#/components/responses/EmailList" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "409": { - "$ref": "#/components/responses/error" - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Add email addresses", @@ -36230,8 +34762,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Unfollow a user", @@ -36256,8 +34788,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Check whether a user is followed by the authenticated user", @@ -36282,11 +34814,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Follow a user", @@ -36302,14 +34831,8 @@ "200": { "$ref": "#/components/responses/string" }, - "401": { - "$ref": "#/components/responses/unauthorized" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a Token to verify", @@ -36325,17 +34848,8 @@ "201": { "$ref": "#/components/responses/GPGKey" }, - "401": { - "$ref": "#/components/responses/unauthorized" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Verify a GPG key", @@ -36369,11 +34883,8 @@ "200": { "$ref": "#/components/responses/GPGKeyList" }, - "401": { - "$ref": "#/components/responses/unauthorized" - }, - "403": { - "$ref": "#/components/responses/forbidden" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List the authenticated user's GPG keys", @@ -36397,17 +34908,8 @@ "201": { "$ref": "#/components/responses/GPGKey" }, - "401": { - "$ref": "#/components/responses/unauthorized" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a GPG key", @@ -36435,14 +34937,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "401": { - "$ref": "#/components/responses/unauthorized" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Remove a GPG key", @@ -36468,14 +34964,8 @@ "200": { "$ref": "#/components/responses/GPGKey" }, - "401": { - "$ref": "#/components/responses/unauthorized" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a GPG key", @@ -36656,11 +35146,8 @@ "200": { "$ref": "#/components/responses/PublicKeyList" }, - "401": { - "$ref": "#/components/responses/unauthorized" - }, - "403": { - "$ref": "#/components/responses/forbidden" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List the authenticated user's public keys", @@ -36684,14 +35171,8 @@ "201": { "$ref": "#/components/responses/PublicKey" }, - "401": { - "$ref": "#/components/responses/unauthorized" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a public key", @@ -36719,14 +35200,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "401": { - "$ref": "#/components/responses/unauthorized" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a public key", @@ -36752,14 +35227,8 @@ "200": { "$ref": "#/components/responses/PublicKey" }, - "401": { - "$ref": "#/components/responses/unauthorized" - }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a public key", @@ -36793,8 +35262,8 @@ "200": { "$ref": "#/components/responses/OrganizationList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List the current user's organizations", @@ -36864,8 +35333,8 @@ "201": { "$ref": "#/components/responses/Project" }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a project owned by the authenticated user", @@ -36893,8 +35362,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a project", @@ -36920,8 +35389,8 @@ "200": { "$ref": "#/components/responses/Project" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a project", @@ -36957,11 +35426,8 @@ "200": { "$ref": "#/components/responses/Project" }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Edit a project", @@ -37005,8 +35471,8 @@ "200": { "$ref": "#/components/responses/ProjectColumnList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a project's columns", @@ -37042,14 +35508,8 @@ "201": { "$ref": "#/components/responses/ProjectColumn" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a column in a project", @@ -37088,14 +35548,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Reorder a project's columns", @@ -37134,14 +35588,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a project column", @@ -37177,8 +35625,8 @@ "200": { "$ref": "#/components/responses/ProjectColumn" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a project column", @@ -37224,14 +35672,8 @@ "200": { "$ref": "#/components/responses/ProjectColumn" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Edit a project column", @@ -37270,11 +35712,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Set a project's default column", @@ -37328,8 +35767,8 @@ "200": { "$ref": "#/components/responses/IssueList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List the issues in a project column", @@ -37377,14 +35816,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Remove an issue from a project column", @@ -37431,17 +35864,8 @@ "201": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Add an issue to a project column", @@ -37489,17 +35913,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" - }, - "423": { - "$ref": "#/components/responses/repoArchivedError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Move an issue between a project's columns", @@ -37543,8 +35958,8 @@ "200": { "$ref": "#/components/responses/ProjectWorkflowList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a project's workflows", @@ -37580,14 +35995,8 @@ "201": { "$ref": "#/components/responses/ProjectWorkflow" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Create a project workflow", @@ -37625,11 +36034,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Delete a project workflow", @@ -37665,8 +36071,8 @@ "200": { "$ref": "#/components/responses/ProjectWorkflow" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a project workflow", @@ -37712,14 +36118,8 @@ "200": { "$ref": "#/components/responses/ProjectWorkflow" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { - "$ref": "#/components/responses/validationError" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Edit a project workflow", @@ -37775,14 +36175,8 @@ "201": { "$ref": "#/components/responses/Repository" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "409": { - "description": "The repository with the same name already exists." - }, - "422": { - "$ref": "#/components/responses/validationError" } }, "summary": "Create a repository", @@ -37852,8 +36246,8 @@ "200": { "$ref": "#/components/responses/RepositoryList" }, - "403": { - "$ref": "#/components/responses/forbidden" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "The repos that the authenticated user has starred", @@ -37889,11 +36283,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Unstar the given repo", @@ -37927,11 +36318,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Whether the authenticated is starring the repo", @@ -37965,11 +36353,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Star the given repo", @@ -38209,8 +36594,8 @@ "200": { "$ref": "#/components/responses/User" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a user", @@ -38270,8 +36655,8 @@ "200": { "$ref": "#/components/responses/ActivityFeedsList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a user's activity feeds", @@ -38314,8 +36699,8 @@ "200": { "$ref": "#/components/responses/UserList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List the given user's followers", @@ -38358,8 +36743,8 @@ "200": { "$ref": "#/components/responses/UserList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List the users that the given user is following", @@ -38395,8 +36780,8 @@ "204": { "$ref": "#/components/responses/empty" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Check if one user is following another user", @@ -38439,8 +36824,8 @@ "200": { "$ref": "#/components/responses/GPGKeyList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List the given user's GPG keys", @@ -38467,8 +36852,8 @@ "200": { "$ref": "#/components/responses/UserHeatmapData" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get a user's heatmap", @@ -38519,8 +36904,8 @@ "200": { "$ref": "#/components/responses/PublicKeyList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List the given user's public keys", @@ -38563,8 +36948,8 @@ "200": { "$ref": "#/components/responses/OrganizationList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a user's organizations", @@ -38600,11 +36985,8 @@ "200": { "$ref": "#/components/responses/OrganizationPermissions" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "Get user permissions in organization", @@ -38661,8 +37043,8 @@ "200": { "$ref": "#/components/responses/ProjectList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List a user's projects", @@ -38705,8 +37087,8 @@ "200": { "$ref": "#/components/responses/RepositoryList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List the repos owned by the given user", @@ -38749,11 +37131,8 @@ "200": { "$ref": "#/components/responses/RepositoryList" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "The repos that the given user has starred", @@ -38796,8 +37175,8 @@ "200": { "$ref": "#/components/responses/RepositoryList" }, - "404": { - "$ref": "#/components/responses/notFound" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List the repositories watched by a user", @@ -38840,8 +37219,8 @@ "200": { "$ref": "#/components/responses/AccessTokenList" }, - "403": { - "$ref": "#/components/responses/forbidden" + "default": { + "$ref": "#/components/responses/error" } }, "summary": "List the authenticated user's access tokens", @@ -38876,11 +37255,8 @@ "201": { "$ref": "#/components/responses/AccessToken" }, - "400": { + "default": { "$ref": "#/components/responses/error" - }, - "403": { - "$ref": "#/components/responses/forbidden" } }, "summary": "Create an access token", @@ -38916,13 +37292,7 @@ "204": { "$ref": "#/components/responses/empty" }, - "403": { - "$ref": "#/components/responses/forbidden" - }, - "404": { - "$ref": "#/components/responses/notFound" - }, - "422": { + "default": { "$ref": "#/components/responses/error" } }, diff --git a/templates/swagger/v1-swagger.generated.json b/templates/swagger/v1-swagger.generated.json index ccddb4a9fab..3be78a74c8d 100644 --- a/templates/swagger/v1-swagger.generated.json +++ b/templates/swagger/v1-swagger.generated.json @@ -67,14 +67,8 @@ "200": { "$ref": "#/responses/WorkflowJobsList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -101,11 +95,8 @@ "200": { "$ref": "#/responses/RunnerList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -150,11 +141,8 @@ "200": { "$ref": "#/responses/Runner" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -180,11 +168,8 @@ "204": { "description": "runner has been deleted" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -220,14 +205,8 @@ "200": { "$ref": "#/responses/Runner" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -290,11 +269,8 @@ "200": { "$ref": "#/responses/WorkflowRunsList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -327,8 +303,8 @@ "200": { "$ref": "#/responses/CronList" }, - "403": { - "$ref": "#/responses/forbidden" + "default": { + "$ref": "#/responses/error" } } } @@ -356,8 +332,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -390,8 +366,8 @@ "200": { "$ref": "#/responses/EmailList" }, - "403": { - "$ref": "#/responses/forbidden" + "default": { + "$ref": "#/responses/error" } } } @@ -430,8 +406,8 @@ "200": { "$ref": "#/responses/EmailList" }, - "403": { - "$ref": "#/responses/forbidden" + "default": { + "$ref": "#/responses/error" } } } @@ -622,8 +598,8 @@ "200": { "$ref": "#/responses/OrganizationList" }, - "403": { - "$ref": "#/responses/forbidden" + "default": { + "$ref": "#/responses/error" } } } @@ -692,8 +668,8 @@ "200": { "$ref": "#/responses/PackageList" }, - "403": { - "$ref": "#/responses/forbidden" + "default": { + "$ref": "#/responses/error" } } } @@ -732,8 +708,8 @@ "200": { "$ref": "#/responses/StringSlice" }, - "403": { - "$ref": "#/responses/forbidden" + "default": { + "$ref": "#/responses/error" } } } @@ -768,11 +744,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -805,8 +778,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" + "default": { + "$ref": "#/responses/error" } } } @@ -906,11 +879,8 @@ "200": { "$ref": "#/responses/UserList" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } }, @@ -939,17 +909,8 @@ "201": { "$ref": "#/responses/User" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "409": { - "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -983,14 +944,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } }, @@ -1026,17 +981,8 @@ "200": { "$ref": "#/responses/User" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "409": { - "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -1064,8 +1010,8 @@ "200": { "$ref": "#/responses/BadgeList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -1101,8 +1047,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" + "default": { + "$ref": "#/responses/error" } } }, @@ -1135,11 +1081,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -1177,11 +1120,8 @@ "201": { "$ref": "#/responses/PublicKey" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -1217,11 +1157,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -1260,11 +1197,8 @@ "201": { "$ref": "#/responses/Organization" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -1300,11 +1234,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -1343,20 +1274,8 @@ "201": { "$ref": "#/responses/Repository" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { - "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -1401,8 +1320,8 @@ "200": { "$ref": "#/responses/GitignoreTemplateInfo" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -1447,8 +1366,8 @@ "200": { "$ref": "#/responses/LabelTemplateInfo" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -1493,8 +1412,8 @@ "200": { "$ref": "#/responses/LicenseTemplateInfo" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -1525,8 +1444,8 @@ "200": { "$ref": "#/responses/MarkdownRender" }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -1559,8 +1478,8 @@ "200": { "$ref": "#/responses/MarkdownRender" }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -1591,8 +1510,8 @@ "200": { "$ref": "#/responses/MarkupRender" }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -1766,11 +1685,8 @@ "200": { "$ref": "#/responses/NotificationThread" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -1806,11 +1722,8 @@ "205": { "$ref": "#/responses/NotificationThread" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -1849,14 +1762,8 @@ "201": { "$ref": "#/responses/Repository" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -1917,11 +1824,8 @@ "201": { "$ref": "#/responses/Organization" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -1949,8 +1853,8 @@ "200": { "$ref": "#/responses/Organization" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -1976,8 +1880,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -2014,8 +1918,8 @@ "200": { "$ref": "#/responses/Organization" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -2061,11 +1965,8 @@ "200": { "$ref": "#/responses/WorkflowJobsList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -2099,11 +2000,8 @@ "200": { "$ref": "#/responses/RunnerList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -2164,11 +2062,8 @@ "200": { "$ref": "#/responses/Runner" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -2201,11 +2096,8 @@ "204": { "description": "runner has been deleted" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -2248,14 +2140,8 @@ "200": { "$ref": "#/responses/Runner" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -2325,11 +2211,8 @@ "200": { "$ref": "#/responses/WorkflowRunsList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -2369,8 +2252,8 @@ "200": { "$ref": "#/responses/SecretList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -2418,11 +2301,8 @@ "204": { "description": "response when updating a secret" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -2458,11 +2338,8 @@ "204": { "description": "delete one secret of the organization" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -2502,11 +2379,8 @@ "200": { "$ref": "#/responses/VariableList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -2541,11 +2415,8 @@ "200": { "$ref": "#/responses/ActionVariable" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -2591,11 +2462,8 @@ "204": { "description": "response when updating an org-level variable" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -2638,13 +2506,7 @@ "201": { "description": "successfully created the org-level variable" }, - "400": { - "$ref": "#/responses/error" - }, - "409": { - "description": "variable name already exists." - }, - "500": { + "default": { "$ref": "#/responses/error" } } @@ -2684,11 +2546,8 @@ "204": { "description": "response when deleting a variable" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -2735,8 +2594,8 @@ "200": { "$ref": "#/responses/ActivityFeedsList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -2771,8 +2630,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -2798,8 +2657,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -2869,8 +2728,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -2906,11 +2765,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } }, @@ -2940,11 +2796,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -2984,8 +2837,8 @@ "200": { "$ref": "#/responses/HookList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -3022,8 +2875,8 @@ "201": { "$ref": "#/responses/Hook" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -3059,8 +2912,8 @@ "200": { "$ref": "#/responses/Hook" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -3094,8 +2947,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -3139,8 +2992,8 @@ "200": { "$ref": "#/responses/Hook" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -3180,8 +3033,8 @@ "200": { "$ref": "#/responses/LabelList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -3217,11 +3070,8 @@ "201": { "$ref": "#/responses/Label" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -3257,8 +3107,8 @@ "200": { "$ref": "#/responses/Label" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -3289,8 +3139,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -3334,11 +3184,8 @@ "200": { "$ref": "#/responses/Label" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -3378,8 +3225,8 @@ "200": { "$ref": "#/responses/UserList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -3414,8 +3261,8 @@ "303": { "description": "redirection to /orgs/{org}/public_members/{username}" }, - "404": { - "description": "user is not a member" + "default": { + "$ref": "#/responses/error" } } }, @@ -3448,8 +3295,8 @@ "204": { "description": "member removed" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -3501,8 +3348,8 @@ "200": { "$ref": "#/responses/ProjectList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -3538,11 +3385,8 @@ "201": { "$ref": "#/responses/Project" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -3578,8 +3422,8 @@ "200": { "$ref": "#/responses/Project" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -3610,8 +3454,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -3655,11 +3499,8 @@ "200": { "$ref": "#/responses/Project" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -3707,8 +3548,8 @@ "200": { "$ref": "#/responses/ProjectColumnList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -3752,14 +3593,8 @@ "201": { "$ref": "#/responses/ProjectColumn" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -3803,14 +3638,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -3854,8 +3683,8 @@ "200": { "$ref": "#/responses/ProjectColumn" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -3895,14 +3724,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } }, @@ -3954,14 +3777,8 @@ "200": { "$ref": "#/responses/ProjectColumn" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -4003,11 +3820,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -4063,8 +3877,8 @@ "200": { "$ref": "#/responses/IssueList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -4114,17 +3928,8 @@ "201": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } }, @@ -4171,14 +3976,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -4229,17 +4028,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -4287,8 +4077,8 @@ "200": { "$ref": "#/responses/ProjectWorkflowList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -4332,14 +4122,8 @@ "201": { "$ref": "#/responses/ProjectWorkflow" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -4383,8 +4167,8 @@ "200": { "$ref": "#/responses/ProjectWorkflow" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -4423,11 +4207,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -4479,14 +4260,8 @@ "200": { "$ref": "#/responses/ProjectWorkflow" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -4526,8 +4301,8 @@ "200": { "$ref": "#/responses/UserList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -4559,8 +4334,8 @@ "204": { "description": "user is a public member" }, - "404": { - "description": "user is not a public member" + "default": { + "$ref": "#/responses/error" } } }, @@ -4593,11 +4368,8 @@ "204": { "description": "membership publicized" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -4630,11 +4402,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -4670,11 +4439,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -4714,8 +4480,8 @@ "200": { "$ref": "#/responses/RepositoryList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -4751,14 +4517,8 @@ "201": { "$ref": "#/responses/Repository" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -4787,11 +4547,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -4831,8 +4588,8 @@ "200": { "$ref": "#/responses/TeamList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -4868,11 +4625,8 @@ "201": { "$ref": "#/responses/Team" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -4938,8 +4692,8 @@ } } }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -5015,8 +4769,8 @@ "200": { "$ref": "#/responses/PackageList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -5070,8 +4824,8 @@ "200": { "$ref": "#/responses/PackageList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -5108,8 +4862,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -5151,8 +4905,8 @@ "200": { "$ref": "#/responses/Package" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -5198,8 +4952,8 @@ "201": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -5238,8 +4992,8 @@ "201": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -5288,8 +5042,8 @@ "200": { "$ref": "#/responses/Package" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -5333,8 +5087,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -5383,8 +5137,8 @@ "200": { "$ref": "#/responses/PackageFileList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -5527,11 +5281,8 @@ "200": { "$ref": "#/responses/IssueList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -5562,14 +5313,8 @@ "201": { "$ref": "#/responses/Repository" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "409": { - "description": "The repository with the same name already exists." - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -5696,8 +5441,8 @@ "200": { "$ref": "#/responses/SearchResults" }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -5732,8 +5477,8 @@ "200": { "$ref": "#/responses/Repository" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -5766,11 +5511,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -5811,14 +5553,8 @@ "200": { "$ref": "#/responses/Repository" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -5859,11 +5595,8 @@ "200": { "$ref": "#/responses/ArtifactsList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -5905,11 +5638,8 @@ "200": { "$ref": "#/responses/Artifact" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -5949,11 +5679,8 @@ "204": { "description": "No Content" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -5995,11 +5722,8 @@ "302": { "description": "redirect to the blob download" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -6064,14 +5788,8 @@ "200": { "$ref": "#/responses/WorkflowJobsList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -6113,11 +5831,8 @@ "200": { "$ref": "#/responses/WorkflowJob" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -6159,11 +5874,8 @@ "200": { "description": "output blob content" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -6204,11 +5916,8 @@ "200": { "$ref": "#/responses/RunnerList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -6283,11 +5992,8 @@ "200": { "$ref": "#/responses/Runner" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -6327,11 +6033,8 @@ "204": { "description": "runner has been deleted" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -6381,14 +6084,8 @@ "200": { "$ref": "#/responses/Runner" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -6471,11 +6168,8 @@ "200": { "$ref": "#/responses/WorkflowRunsList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -6517,11 +6211,8 @@ "200": { "$ref": "#/responses/WorkflowRun" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -6561,11 +6252,8 @@ "204": { "description": "No Content" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -6607,17 +6295,8 @@ "200": { "$ref": "#/responses/WorkflowRun" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { - "$ref": "#/responses/conflict" } } } @@ -6665,11 +6344,8 @@ "200": { "$ref": "#/responses/ArtifactsList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -6718,11 +6394,8 @@ "200": { "$ref": "#/responses/WorkflowRun" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -6789,11 +6462,8 @@ "200": { "$ref": "#/responses/WorkflowJobsList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -6835,17 +6505,8 @@ "200": { "$ref": "#/responses/WorkflowRun" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { - "$ref": "#/responses/conflict" } } } @@ -6888,17 +6549,8 @@ "200": { "$ref": "#/responses/WorkflowRun" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { - "$ref": "#/responses/conflict" } } } @@ -6970,14 +6622,8 @@ "200": { "$ref": "#/responses/WorkflowJobsList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -7026,20 +6672,8 @@ "201": { "$ref": "#/responses/WorkflowJob" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { - "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -7081,8 +6715,8 @@ "200": { "description": "Logs archive" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -7124,20 +6758,8 @@ "201": { "$ref": "#/responses/WorkflowRun" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { - "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -7176,20 +6798,8 @@ "201": { "$ref": "#/responses/empty" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { - "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -7236,8 +6846,8 @@ "200": { "$ref": "#/responses/SecretList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -7292,11 +6902,8 @@ "204": { "description": "response when updating a secret" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -7339,11 +6946,8 @@ "204": { "description": "delete one secret of the repository" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -7390,20 +6994,8 @@ "200": { "$ref": "#/responses/TasksList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { - "$ref": "#/responses/conflict" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -7450,11 +7042,8 @@ "200": { "$ref": "#/responses/VariableList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -7496,11 +7085,8 @@ "200": { "$ref": "#/responses/ActionVariable" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -7550,11 +7136,8 @@ "204": { "description": "response when updating a repo-level variable" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -7601,13 +7184,7 @@ "201": { "description": "response when creating a repo-level variable" }, - "400": { - "$ref": "#/responses/error" - }, - "409": { - "description": "variable name already exists." - }, - "500": { + "default": { "$ref": "#/responses/error" } } @@ -7654,11 +7231,8 @@ "204": { "description": "response when deleting a variable" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -7693,19 +7267,7 @@ "200": { "$ref": "#/responses/ActionWorkflowList" }, - "400": { - "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "500": { + "default": { "$ref": "#/responses/error" } } @@ -7748,19 +7310,7 @@ "200": { "$ref": "#/responses/ActionWorkflow" }, - "400": { - "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "500": { + "default": { "$ref": "#/responses/error" } } @@ -7803,17 +7353,8 @@ "204": { "description": "No Content" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -7878,17 +7419,8 @@ "204": { "description": "No Content, if return_run_details is missing or false" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -7930,20 +7462,8 @@ "204": { "description": "No Content" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { - "$ref": "#/responses/conflict" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -8040,14 +7560,8 @@ "200": { "$ref": "#/responses/WorkflowRunsList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -8101,8 +7615,8 @@ "200": { "$ref": "#/responses/ActivityFeedsList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -8154,8 +7668,8 @@ "200": { "description": "success" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -8190,8 +7704,8 @@ "200": { "$ref": "#/responses/UserList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -8233,11 +7747,8 @@ "204": { "$ref": "#/responses/empty" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -8279,8 +7790,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -8313,8 +7824,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -8390,17 +7901,8 @@ "201": { "$ref": "#/responses/BranchProtection" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -8445,14 +7947,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -8494,8 +7990,8 @@ "200": { "$ref": "#/responses/BranchProtection" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -8535,8 +8031,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -8586,14 +8082,8 @@ "200": { "$ref": "#/responses/BranchProtection" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -8687,17 +8177,8 @@ "201": { "$ref": "#/responses/Branch" }, - "403": { - "description": "The branch is archived or a mirror." - }, - "404": { - "description": "The old branch does not exist." - }, - "409": { - "description": "The branch with the same name already exists." - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -8739,8 +8220,8 @@ "200": { "$ref": "#/responses/Branch" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -8790,17 +8271,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { - "$ref": "#/responses/conflict" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } }, @@ -8840,14 +8312,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "423": { - "$ref": "#/responses/repoArchivedError" } } }, @@ -8897,14 +8363,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -8951,8 +8411,8 @@ "200": { "$ref": "#/responses/UserList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -8994,11 +8454,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } }, @@ -9045,14 +8502,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } }, @@ -9092,11 +8543,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -9138,11 +8586,8 @@ "200": { "$ref": "#/responses/RepoCollaboratorPermission" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -9239,11 +8684,8 @@ "200": { "$ref": "#/responses/CommitList" }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { - "$ref": "#/responses/EmptyRepository" + "default": { + "$ref": "#/responses/error" } } } @@ -9297,11 +8739,8 @@ "200": { "$ref": "#/responses/CombinedStatus" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -9381,11 +8820,8 @@ "200": { "$ref": "#/responses/CommitStatusList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -9427,8 +8863,8 @@ "200": { "$ref": "#/responses/PullRequest" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -9494,11 +8930,8 @@ "200": { "$ref": "#/responses/Compare" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -9540,8 +8973,8 @@ "200": { "$ref": "#/responses/ContentsListResponse" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -9585,17 +9018,8 @@ "201": { "$ref": "#/responses/FilesResponse" }, - "403": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/error" - }, - "423": { - "$ref": "#/responses/repoArchivedError" } } } @@ -9650,8 +9074,8 @@ "200": { "$ref": "#/responses/ContentsExtResponse" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -9700,8 +9124,8 @@ "200": { "$ref": "#/responses/ContentsResponse" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -9755,17 +9179,8 @@ "201": { "$ref": "#/responses/FileResponse" }, - "403": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/error" - }, - "423": { - "$ref": "#/responses/repoArchivedError" } } }, @@ -9816,17 +9231,8 @@ "201": { "$ref": "#/responses/FileResponse" }, - "403": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/error" - }, - "423": { - "$ref": "#/responses/repoArchivedError" } } }, @@ -9877,20 +9283,8 @@ "200": { "$ref": "#/responses/FileDeleteResponse" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/error" - }, - "423": { - "$ref": "#/responses/repoArchivedError" } } } @@ -9936,11 +9330,8 @@ "200": { "$ref": "#/responses/FileResponse" }, - "404": { - "$ref": "#/responses/notFound" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -9988,8 +9379,8 @@ "200": { "description": "success" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -10038,8 +9429,8 @@ "200": { "$ref": "#/responses/ContentsListResponse" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -10087,8 +9478,8 @@ "200": { "$ref": "#/responses/ContentsListResponse" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -10135,8 +9526,8 @@ "200": { "$ref": "#/responses/RepositoryList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -10176,17 +9567,8 @@ "202": { "$ref": "#/responses/Repository" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { - "description": "The repository with the same name already exists." - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -10228,11 +9610,8 @@ "200": { "$ref": "#/responses/GitBlobResponse" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -10292,11 +9671,8 @@ "200": { "$ref": "#/responses/Commit" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -10349,8 +9725,8 @@ "200": { "$ref": "#/responses/string" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -10404,11 +9780,8 @@ "200": { "$ref": "#/responses/Note" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -10443,8 +9816,8 @@ "200": { "$ref": "#/responses/ReferenceList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -10486,8 +9859,8 @@ "200": { "$ref": "#/responses/ReferenceList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -10529,11 +9902,8 @@ "200": { "$ref": "#/responses/AnnotatedTag" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -10593,11 +9963,8 @@ "200": { "$ref": "#/responses/GitTreeResponse" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -10644,8 +10011,8 @@ "200": { "$ref": "#/responses/HookList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -10688,8 +10055,8 @@ "201": { "$ref": "#/responses/Hook" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -10724,8 +10091,8 @@ "200": { "$ref": "#/responses/GitHookList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -10767,8 +10134,8 @@ "200": { "$ref": "#/responses/GitHook" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -10808,8 +10175,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -10856,8 +10223,8 @@ "200": { "$ref": "#/responses/GitHook" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -10900,8 +10267,8 @@ "200": { "$ref": "#/responses/Hook" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -10942,8 +10309,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -10991,8 +10358,8 @@ "200": { "$ref": "#/responses/Hook" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -11047,8 +10414,8 @@ "200": { "$ref": "#/responses/HookDeliveryList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -11098,8 +10465,8 @@ "200": { "$ref": "#/responses/HookDelivery" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -11148,8 +10515,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -11184,8 +10551,8 @@ "200": { "$ref": "#/responses/RepoIssueConfig" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -11220,8 +10587,8 @@ "200": { "$ref": "#/responses/RepoIssueConfigValidation" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -11256,8 +10623,8 @@ "200": { "$ref": "#/responses/IssueTemplates" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -11375,8 +10742,8 @@ "200": { "$ref": "#/responses/IssueList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -11419,20 +10786,8 @@ "201": { "$ref": "#/responses/Issue" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "412": { + "default": { "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" } } } @@ -11493,8 +10848,8 @@ "200": { "$ref": "#/responses/CommentList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -11543,11 +10898,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -11585,11 +10937,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -11643,14 +10992,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -11693,7 +11036,7 @@ "200": { "$ref": "#/responses/AttachmentList" }, - "404": { + "default": { "$ref": "#/responses/error" } } @@ -11751,23 +11094,8 @@ "201": { "$ref": "#/responses/Attachment" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/error" - }, - "413": { - "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" } } } @@ -11818,7 +11146,7 @@ "200": { "$ref": "#/responses/Attachment" }, - "404": { + "default": { "$ref": "#/responses/error" } } @@ -11868,11 +11196,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { + "default": { "$ref": "#/responses/error" - }, - "423": { - "$ref": "#/responses/repoArchivedError" } } }, @@ -11931,14 +11256,8 @@ "201": { "$ref": "#/responses/Attachment" }, - "404": { + "default": { "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" } } } @@ -11984,11 +11303,8 @@ "200": { "$ref": "#/responses/ReactionList" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -12042,11 +11358,8 @@ "201": { "$ref": "#/responses/Reaction" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -12097,11 +11410,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -12136,8 +11446,8 @@ "200": { "$ref": "#/responses/IssueList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -12180,8 +11490,8 @@ "200": { "$ref": "#/responses/Issue" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -12219,14 +11529,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } }, @@ -12278,17 +11582,8 @@ "201": { "$ref": "#/responses/Issue" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "412": { + "default": { "$ref": "#/responses/error" - }, - "423": { - "$ref": "#/responses/repoArchivedError" } } } @@ -12331,7 +11626,7 @@ "200": { "$ref": "#/responses/AttachmentList" }, - "404": { + "default": { "$ref": "#/responses/error" } } @@ -12389,20 +11684,8 @@ "201": { "$ref": "#/responses/Attachment" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/error" - }, - "413": { - "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" } } } @@ -12453,7 +11736,7 @@ "200": { "$ref": "#/responses/Attachment" }, - "404": { + "default": { "$ref": "#/responses/error" } } @@ -12503,11 +11786,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { + "default": { "$ref": "#/responses/error" - }, - "423": { - "$ref": "#/responses/repoArchivedError" } } }, @@ -12566,14 +11846,8 @@ "201": { "$ref": "#/responses/Attachment" }, - "404": { + "default": { "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" } } } @@ -12627,17 +11901,8 @@ "201": { "$ref": "#/responses/Issue" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" } } }, @@ -12689,14 +11954,8 @@ "200": { "$ref": "#/responses/Issue" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -12746,11 +12005,8 @@ "204": { "$ref": "#/responses/empty" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -12804,8 +12060,8 @@ "200": { "$ref": "#/responses/IssueList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -12852,8 +12108,8 @@ "201": { "$ref": "#/responses/Issue" }, - "404": { - "description": "the issue does not exist" + "default": { + "$ref": "#/responses/error" } } }, @@ -12900,8 +12156,8 @@ "200": { "$ref": "#/responses/Issue" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -12958,8 +12214,8 @@ "200": { "$ref": "#/responses/CommentList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -13010,14 +12266,8 @@ "201": { "$ref": "#/responses/Comment" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -13065,11 +12315,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -13131,11 +12378,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -13188,11 +12432,8 @@ "201": { "$ref": "#/responses/IssueDeadline" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -13246,8 +12487,8 @@ "200": { "$ref": "#/responses/IssueList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -13294,11 +12535,8 @@ "201": { "$ref": "#/responses/Issue" }, - "404": { - "description": "the issue does not exist" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } }, @@ -13345,11 +12583,8 @@ "200": { "$ref": "#/responses/Issue" }, - "404": { - "$ref": "#/responses/notFound" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -13392,8 +12627,8 @@ "200": { "$ref": "#/responses/LabelList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -13444,14 +12679,8 @@ "200": { "$ref": "#/responses/LabelList" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } }, @@ -13502,14 +12731,8 @@ "200": { "$ref": "#/responses/LabelList" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } }, @@ -13550,14 +12773,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -13608,17 +12825,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -13671,11 +12879,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -13719,11 +12924,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -13763,11 +12965,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -13805,11 +13004,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -13857,11 +13053,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -13919,11 +13112,8 @@ "200": { "$ref": "#/responses/ReactionList" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -13977,11 +13167,8 @@ "201": { "$ref": "#/responses/Reaction" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -14032,11 +13219,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -14082,14 +13266,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "description": "Not repo writer, user does not have rights to toggle stopwatch" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { - "description": "Cannot cancel a non-existent stopwatch" + "default": { + "$ref": "#/responses/error" } } } @@ -14135,14 +13313,8 @@ "201": { "$ref": "#/responses/empty" }, - "403": { - "description": "Not repo writer, user does not have rights to toggle stopwatch" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { - "description": "Cannot start a stopwatch again if it already exists" + "default": { + "$ref": "#/responses/error" } } } @@ -14188,14 +13360,8 @@ "201": { "$ref": "#/responses/empty" }, - "403": { - "description": "Not repo writer, user does not have rights to toggle stopwatch" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { - "description": "Cannot stop a non-existent stopwatch" + "default": { + "$ref": "#/responses/error" } } } @@ -14253,8 +13419,8 @@ "200": { "$ref": "#/responses/UserList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -14300,8 +13466,8 @@ "200": { "$ref": "#/responses/WatchInfo" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -14360,8 +13526,8 @@ "304": { "description": "User can only subscribe itself if he is no admin" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -14418,8 +13584,8 @@ "304": { "description": "User can only subscribe itself if he is no admin" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -14488,8 +13654,8 @@ "200": { "$ref": "#/responses/TimelineList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -14564,8 +13730,8 @@ "200": { "$ref": "#/responses/TrackedTimeList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -14616,14 +13782,8 @@ "200": { "$ref": "#/responses/TrackedTime" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -14667,14 +13827,8 @@ "204": { "$ref": "#/responses/empty" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -14728,14 +13882,8 @@ "204": { "$ref": "#/responses/empty" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -14794,8 +13942,8 @@ "200": { "$ref": "#/responses/DeployKeyList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -14838,11 +13986,8 @@ "201": { "$ref": "#/responses/DeployKey" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -14887,11 +14032,8 @@ "201": { "$ref": "#/responses/DeployKey" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -14934,8 +14076,8 @@ "200": { "$ref": "#/responses/DeployKey" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -14973,11 +14115,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -15024,8 +14163,8 @@ "200": { "$ref": "#/responses/LabelList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -15068,11 +14207,8 @@ "201": { "$ref": "#/responses/Label" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -15115,8 +14251,8 @@ "200": { "$ref": "#/responses/Label" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -15154,8 +14290,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -15206,11 +14342,8 @@ "200": { "$ref": "#/responses/Label" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -15245,8 +14378,8 @@ "200": { "$ref": "#/responses/LanguageStatistics" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -15281,8 +14414,8 @@ "200": { "$ref": "#/responses/LicensesList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -15333,8 +14466,8 @@ "type": "file" } }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -15376,13 +14509,7 @@ "200": { "$ref": "#/responses/MergeUpstreamResponse" }, - "400": { - "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { + "default": { "$ref": "#/responses/error" } } @@ -15442,8 +14569,8 @@ "200": { "$ref": "#/responses/MilestoneList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -15486,8 +14613,8 @@ "201": { "$ref": "#/responses/Milestone" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -15529,8 +14656,8 @@ "200": { "$ref": "#/responses/Milestone" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -15567,8 +14694,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -15618,8 +14745,8 @@ "200": { "$ref": "#/responses/Milestone" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -15654,11 +14781,8 @@ "200": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -15693,8 +14817,8 @@ "200": { "$ref": "#/responses/RepoNewIssuePinsAllowed" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -15910,8 +15034,8 @@ "200": { "$ref": "#/responses/ProjectList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -15954,14 +15078,8 @@ "201": { "$ref": "#/responses/Project" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -16004,8 +15122,8 @@ "200": { "$ref": "#/responses/Project" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -16043,11 +15161,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } }, @@ -16098,14 +15213,8 @@ "200": { "$ref": "#/responses/Project" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -16160,8 +15269,8 @@ "200": { "$ref": "#/responses/ProjectColumnList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -16212,17 +15321,8 @@ "201": { "$ref": "#/responses/ProjectColumn" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -16273,17 +15373,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -16334,8 +15425,8 @@ "200": { "$ref": "#/responses/ProjectColumn" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -16382,17 +15473,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } }, @@ -16451,17 +15533,8 @@ "200": { "$ref": "#/responses/ProjectColumn" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -16510,14 +15583,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -16580,8 +15647,8 @@ "200": { "$ref": "#/responses/IssueList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -16638,17 +15705,8 @@ "201": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } }, @@ -16702,14 +15760,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -16767,17 +15819,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -16832,8 +15875,8 @@ "200": { "$ref": "#/responses/ProjectWorkflowList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -16884,17 +15927,8 @@ "201": { "$ref": "#/responses/ProjectWorkflow" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -16945,8 +15979,8 @@ "200": { "$ref": "#/responses/ProjectWorkflow" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -16992,14 +16026,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } }, @@ -17058,17 +16086,8 @@ "200": { "$ref": "#/responses/ProjectWorkflow" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -17175,10 +16194,7 @@ "200": { "$ref": "#/responses/PullRequestList" }, - "404": { - "$ref": "#/responses/notFound" - }, - "500": { + "default": { "$ref": "#/responses/error" } } @@ -17222,20 +16238,8 @@ "201": { "$ref": "#/responses/PullRequest" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { + "default": { "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" } } } @@ -17278,14 +16282,8 @@ "204": { "$ref": "#/responses/empty" }, - "400": { - "$ref": "#/responses/validationError" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -17328,14 +16326,8 @@ "204": { "$ref": "#/responses/empty" }, - "400": { - "$ref": "#/responses/validationError" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -17370,8 +16362,8 @@ "200": { "$ref": "#/responses/PullRequestList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -17420,8 +16412,8 @@ "200": { "$ref": "#/responses/PullRequest" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -17464,8 +16456,8 @@ "200": { "$ref": "#/responses/PullRequest" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -17516,23 +16508,8 @@ "201": { "$ref": "#/responses/PullRequest" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { - "$ref": "#/responses/error" - }, - "412": { - "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -17592,8 +16569,8 @@ "200": { "$ref": "#/responses/string" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -17655,14 +16632,8 @@ "201": { "$ref": "#/responses/PullReviewComment" }, - "400": { - "$ref": "#/responses/validationError" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -17729,8 +16700,8 @@ "200": { "$ref": "#/responses/CommitList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -17803,8 +16774,8 @@ "200": { "$ref": "#/responses/ChangedFileList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -17847,8 +16818,8 @@ "204": { "description": "pull request has been merged" }, - "404": { - "description": "pull request has not been merged" + "default": { + "$ref": "#/responses/error" } } }, @@ -17896,20 +16867,8 @@ "200": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "405": { - "$ref": "#/responses/empty" - }, - "409": { + "default": { "$ref": "#/responses/error" - }, - "423": { - "$ref": "#/responses/repoArchivedError" } } }, @@ -17950,14 +16909,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -18008,11 +16961,8 @@ "201": { "$ref": "#/responses/PullReviewList" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } }, @@ -18061,14 +17011,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -18123,8 +17067,8 @@ "200": { "$ref": "#/responses/PullReviewList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -18173,11 +17117,8 @@ "200": { "$ref": "#/responses/PullReview" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -18228,8 +17169,8 @@ "200": { "$ref": "#/responses/PullReview" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -18286,11 +17227,8 @@ "200": { "$ref": "#/responses/PullReview" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } }, @@ -18339,11 +17277,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -18394,8 +17329,8 @@ "200": { "$ref": "#/responses/PullReviewCommentList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -18454,14 +17389,8 @@ "200": { "$ref": "#/responses/PullReview" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -18512,14 +17441,8 @@ "200": { "$ref": "#/responses/PullReview" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -18572,17 +17495,8 @@ "200": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { + "default": { "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -18629,14 +17543,8 @@ "200": { "$ref": "#/responses/PushMirrorList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -18679,14 +17587,8 @@ "200": { "$ref": "#/responses/PushMirror" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -18721,17 +17623,8 @@ "200": { "$ref": "#/responses/empty" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -18773,14 +17666,8 @@ "200": { "$ref": "#/responses/PushMirror" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -18820,11 +17707,8 @@ "204": { "$ref": "#/responses/empty" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -18875,8 +17759,8 @@ "type": "file" } }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -18941,8 +17825,8 @@ "200": { "$ref": "#/responses/ReleaseList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -18985,14 +17869,8 @@ "201": { "$ref": "#/responses/Release" }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { + "default": { "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -19027,8 +17905,8 @@ "200": { "$ref": "#/responses/Release" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -19070,8 +17948,8 @@ "200": { "$ref": "#/responses/Release" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -19108,11 +17986,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -19155,8 +18030,8 @@ "200": { "$ref": "#/responses/Release" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -19194,11 +18069,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } }, @@ -19249,8 +18121,8 @@ "200": { "$ref": "#/responses/Release" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -19293,8 +18165,8 @@ "200": { "$ref": "#/responses/AttachmentList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -19351,13 +18223,7 @@ "201": { "$ref": "#/responses/Attachment" }, - "400": { - "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "413": { + "default": { "$ref": "#/responses/error" } } @@ -19409,8 +18275,8 @@ "200": { "$ref": "#/responses/Attachment" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -19459,8 +18325,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -19519,11 +18385,8 @@ "201": { "$ref": "#/responses/Attachment" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -19558,8 +18421,8 @@ "200": { "$ref": "#/responses/UserList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -19678,11 +18541,8 @@ "200": { "$ref": "#/responses/UserList" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -19762,11 +18622,8 @@ "200": { "$ref": "#/responses/CommitStatusList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -19813,11 +18670,8 @@ "201": { "$ref": "#/responses/CommitStatus" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -19864,8 +18718,8 @@ "200": { "$ref": "#/responses/UserList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -19897,8 +18751,8 @@ "200": { "$ref": "#/responses/WatchInfo" }, - "404": { - "description": "User is not watching this repo or repo do not exist" + "default": { + "$ref": "#/responses/error" } } }, @@ -19928,11 +18782,8 @@ "200": { "$ref": "#/responses/WatchInfo" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -19962,8 +18813,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -20039,17 +18890,8 @@ "201": { "$ref": "#/responses/TagProtection" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -20091,8 +18933,8 @@ "200": { "$ref": "#/responses/TagProtection" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -20132,8 +18974,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -20183,14 +19025,8 @@ "200": { "$ref": "#/responses/TagProtection" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -20237,8 +19073,8 @@ "200": { "$ref": "#/responses/TagList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -20278,20 +19114,8 @@ "200": { "$ref": "#/responses/Tag" }, - "404": { - "$ref": "#/responses/notFound" - }, - "405": { - "$ref": "#/responses/empty" - }, - "409": { - "$ref": "#/responses/conflict" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -20333,8 +19157,8 @@ "200": { "$ref": "#/responses/Tag" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -20374,20 +19198,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" - }, - "405": { - "$ref": "#/responses/empty" - }, - "409": { - "$ref": "#/responses/conflict" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -20422,8 +19234,8 @@ "200": { "$ref": "#/responses/TeamList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -20465,10 +19277,7 @@ "200": { "$ref": "#/responses/Team" }, - "404": { - "$ref": "#/responses/notFound" - }, - "405": { + "default": { "$ref": "#/responses/error" } } @@ -20509,17 +19318,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "405": { + "default": { "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/validationError" } } }, @@ -20559,17 +19359,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "405": { + "default": { "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -20636,14 +19427,8 @@ "200": { "$ref": "#/responses/TrackedTimeList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -20686,14 +19471,8 @@ "200": { "$ref": "#/responses/TrackedTimeList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -20740,8 +19519,8 @@ "200": { "$ref": "#/responses/TopicNames" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -20781,14 +19560,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/invalidTopicsError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -20830,14 +19603,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/invalidTopicsError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } }, @@ -20877,14 +19644,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/invalidTopicsError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -20928,14 +19689,8 @@ "202": { "$ref": "#/responses/Repository" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -20970,11 +19725,8 @@ "202": { "$ref": "#/responses/Repository" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -21009,11 +19761,8 @@ "200": { "$ref": "#/responses/Repository" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -21055,17 +19804,8 @@ "201": { "$ref": "#/responses/WikiPage" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "423": { - "$ref": "#/responses/repoArchivedError" } } } @@ -21107,8 +19847,8 @@ "200": { "$ref": "#/responses/WikiPage" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -21145,14 +19885,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } }, @@ -21199,17 +19933,8 @@ "200": { "$ref": "#/responses/WikiPage" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "423": { - "$ref": "#/responses/repoArchivedError" } } } @@ -21256,8 +19981,8 @@ "200": { "$ref": "#/responses/WikiPageList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -21305,8 +20030,8 @@ "200": { "$ref": "#/responses/WikiCommitList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -21351,17 +20076,8 @@ "201": { "$ref": "#/responses/Repository" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "409": { - "description": "The repository with the same name already exists." - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -21390,8 +20106,8 @@ "200": { "$ref": "#/responses/Repository" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -21528,8 +20244,8 @@ "200": { "$ref": "#/responses/Team" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -21553,8 +20269,8 @@ "204": { "description": "team deleted" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -21590,8 +20306,8 @@ "200": { "$ref": "#/responses/Team" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -21639,8 +20355,8 @@ "200": { "$ref": "#/responses/ActivityFeedsList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -21681,8 +20397,8 @@ "200": { "$ref": "#/responses/UserList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -21718,8 +20434,8 @@ "200": { "$ref": "#/responses/User" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -21753,11 +20469,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -21791,8 +20504,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -21833,8 +20546,8 @@ "200": { "$ref": "#/responses/RepositoryList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -21877,8 +20590,8 @@ "200": { "$ref": "#/responses/Repository" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -21919,11 +20632,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -21965,11 +20675,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -22041,11 +20748,8 @@ "200": { "$ref": "#/responses/TopicListResponse" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -22113,14 +20817,8 @@ "200": { "$ref": "#/responses/WorkflowJobsList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -22147,11 +20845,8 @@ "200": { "$ref": "#/responses/RunnerList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -22196,11 +20891,8 @@ "200": { "$ref": "#/responses/Runner" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -22226,11 +20918,8 @@ "204": { "description": "runner has been deleted" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -22266,14 +20955,8 @@ "200": { "$ref": "#/responses/Runner" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -22336,11 +21019,8 @@ "200": { "$ref": "#/responses/WorkflowRunsList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -22381,11 +21061,8 @@ "204": { "description": "response when updating a secret" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -22414,11 +21091,8 @@ "204": { "description": "delete one secret of the user" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -22451,11 +21125,8 @@ "200": { "$ref": "#/responses/VariableList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -22483,11 +21154,8 @@ "200": { "$ref": "#/responses/ActionVariable" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -22526,11 +21194,8 @@ "204": { "description": "response when updating a variable" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } }, @@ -22566,11 +21231,8 @@ "201": { "description": "successfully created the user-level variable" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "409": { - "description": "variable name already exists." } } }, @@ -22599,11 +21261,8 @@ "204": { "description": "response when deleting a variable" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -22661,7 +21320,7 @@ "201": { "$ref": "#/responses/OAuth2Application" }, - "400": { + "default": { "$ref": "#/responses/error" } } @@ -22691,8 +21350,8 @@ "200": { "$ref": "#/responses/OAuth2Application" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -22719,8 +21378,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -22755,11 +21414,8 @@ "200": { "$ref": "#/responses/OAuth2Application" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "404": { - "$ref": "#/responses/notFound" } } } @@ -22856,8 +21512,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -22886,11 +21542,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } }, @@ -22913,11 +21566,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -22960,14 +21610,8 @@ "201": { "$ref": "#/responses/EmailList" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "409": { - "$ref": "#/responses/error" - }, - "422": { - "$ref": "#/responses/validationError" } } }, @@ -22993,8 +21637,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -23081,8 +21725,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -23105,11 +21749,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -23132,8 +21773,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -23152,14 +21793,8 @@ "200": { "$ref": "#/responses/string" }, - "401": { - "$ref": "#/responses/unauthorized" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -23181,17 +21816,8 @@ "201": { "$ref": "#/responses/GPGKey" }, - "401": { - "$ref": "#/responses/unauthorized" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -23224,11 +21850,8 @@ "200": { "$ref": "#/responses/GPGKeyList" }, - "401": { - "$ref": "#/responses/unauthorized" - }, - "403": { - "$ref": "#/responses/forbidden" + "default": { + "$ref": "#/responses/error" } } }, @@ -23257,17 +21880,8 @@ "201": { "$ref": "#/responses/GPGKey" }, - "401": { - "$ref": "#/responses/unauthorized" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -23296,14 +21910,8 @@ "200": { "$ref": "#/responses/GPGKey" }, - "401": { - "$ref": "#/responses/unauthorized" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -23330,14 +21938,8 @@ "204": { "$ref": "#/responses/empty" }, - "401": { - "$ref": "#/responses/unauthorized" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -23522,11 +22124,8 @@ "200": { "$ref": "#/responses/PublicKeyList" }, - "401": { - "$ref": "#/responses/unauthorized" - }, - "403": { - "$ref": "#/responses/forbidden" + "default": { + "$ref": "#/responses/error" } } }, @@ -23555,14 +22154,8 @@ "201": { "$ref": "#/responses/PublicKey" }, - "401": { - "$ref": "#/responses/unauthorized" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -23591,14 +22184,8 @@ "200": { "$ref": "#/responses/PublicKey" }, - "401": { - "$ref": "#/responses/unauthorized" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -23625,14 +22212,8 @@ "204": { "$ref": "#/responses/empty" }, - "401": { - "$ref": "#/responses/unauthorized" - }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -23665,8 +22246,8 @@ "200": { "$ref": "#/responses/OrganizationList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -23738,8 +22319,8 @@ "201": { "$ref": "#/responses/Project" }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -23768,8 +22349,8 @@ "200": { "$ref": "#/responses/Project" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -23793,8 +22374,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -23831,11 +22412,8 @@ "200": { "$ref": "#/responses/Project" }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -23876,8 +22454,8 @@ "200": { "$ref": "#/responses/ProjectColumnList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -23914,14 +22492,8 @@ "201": { "$ref": "#/responses/ProjectColumn" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -23958,14 +22530,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -24002,8 +22568,8 @@ "200": { "$ref": "#/responses/ProjectColumn" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -24036,14 +22602,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } }, @@ -24088,14 +22648,8 @@ "200": { "$ref": "#/responses/ProjectColumn" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -24130,11 +22684,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -24183,8 +22734,8 @@ "200": { "$ref": "#/responses/IssueList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -24227,17 +22778,8 @@ "201": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } }, @@ -24277,14 +22819,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -24328,17 +22864,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" - }, - "423": { - "$ref": "#/responses/repoArchivedError" + "default": { + "$ref": "#/responses/error" } } } @@ -24379,8 +22906,8 @@ "200": { "$ref": "#/responses/ProjectWorkflowList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -24417,14 +22944,8 @@ "201": { "$ref": "#/responses/ProjectWorkflow" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -24461,8 +22982,8 @@ "200": { "$ref": "#/responses/ProjectWorkflow" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -24494,11 +23015,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -24543,14 +23061,8 @@ "200": { "$ref": "#/responses/ProjectWorkflow" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { - "$ref": "#/responses/validationError" + "default": { + "$ref": "#/responses/error" } } } @@ -24610,14 +23122,8 @@ "201": { "$ref": "#/responses/Repository" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "409": { - "description": "The repository with the same name already exists." - }, - "422": { - "$ref": "#/responses/validationError" } } } @@ -24691,8 +23197,8 @@ "200": { "$ref": "#/responses/RepositoryList" }, - "403": { - "$ref": "#/responses/forbidden" + "default": { + "$ref": "#/responses/error" } } } @@ -24724,11 +23230,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -24758,11 +23261,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } }, @@ -24792,11 +23292,8 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -25023,8 +23520,8 @@ "200": { "$ref": "#/responses/User" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -25077,8 +23574,8 @@ "200": { "$ref": "#/responses/ActivityFeedsList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -25118,8 +23615,8 @@ "200": { "$ref": "#/responses/UserList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -25159,8 +23656,8 @@ "200": { "$ref": "#/responses/UserList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -25192,8 +23689,8 @@ "204": { "$ref": "#/responses/empty" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -25233,8 +23730,8 @@ "200": { "$ref": "#/responses/GPGKeyList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -25262,8 +23759,8 @@ "200": { "$ref": "#/responses/UserHeatmapData" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -25309,8 +23806,8 @@ "200": { "$ref": "#/responses/PublicKeyList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -25350,8 +23847,8 @@ "200": { "$ref": "#/responses/OrganizationList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -25386,11 +23883,8 @@ "200": { "$ref": "#/responses/OrganizationPermissions" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -25442,8 +23936,8 @@ "200": { "$ref": "#/responses/ProjectList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -25483,8 +23977,8 @@ "200": { "$ref": "#/responses/RepositoryList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -25524,11 +24018,8 @@ "200": { "$ref": "#/responses/RepositoryList" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -25568,8 +24059,8 @@ "200": { "$ref": "#/responses/RepositoryList" }, - "404": { - "$ref": "#/responses/notFound" + "default": { + "$ref": "#/responses/error" } } } @@ -25609,8 +24100,8 @@ "200": { "$ref": "#/responses/AccessTokenList" }, - "403": { - "$ref": "#/responses/forbidden" + "default": { + "$ref": "#/responses/error" } } }, @@ -25646,11 +24137,8 @@ "201": { "$ref": "#/responses/AccessToken" }, - "400": { + "default": { "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" } } } @@ -25685,13 +24173,7 @@ "204": { "$ref": "#/responses/empty" }, - "403": { - "$ref": "#/responses/forbidden" - }, - "404": { - "$ref": "#/responses/notFound" - }, - "422": { + "default": { "$ref": "#/responses/error" } } @@ -25716,23 +24198,6 @@ } }, "definitions": { - "APIError": { - "description": "APIError is an api error with a message", - "type": "object", - "properties": { - "message": { - "description": "Message contains the error description", - "type": "string", - "x-go-name": "Message" - }, - "url": { - "description": "URL contains the documentation URL for this error", - "type": "string", - "x-go-name": "URL" - } - }, - "x-go-package": "gitea.dev/modules/structs" - }, "AccessToken": { "type": "object", "title": "AccessToken represents an API access token.", @@ -35567,12 +34032,6 @@ } } }, - "EmptyRepository": { - "description": "EmptyRepository", - "schema": { - "$ref": "#/definitions/APIError" - } - }, "FileDeleteResponse": { "description": "FileDeleteResponse", "schema": { @@ -36359,9 +34818,6 @@ "$ref": "#/definitions/ActionWorkflowRunsResponse" } }, - "conflict": { - "description": "APIConflict is a conflict empty response" - }, "empty": { "description": "APIEmpty is an empty response" }, @@ -36376,72 +34832,11 @@ } } }, - "forbidden": { - "description": "APIForbiddenError is a forbidden error response", - "headers": { - "message": { - "type": "string" - }, - "url": { - "type": "string" - } - } - }, - "invalidTopicsError": { - "description": "APIInvalidTopicsError is error format response to invalid topics", - "headers": { - "invalidTopics": { - "type": "array", - "items": { - "type": "string" - } - }, - "message": { - "type": "string" - } - } - }, - "notFound": { - "description": "APINotFound is a not found empty response" - }, - "repoArchivedError": { - "description": "APIRepoArchivedError is an error that is raised when an archived repo should be modified", - "headers": { - "message": { - "type": "string" - }, - "url": { - "type": "string" - } - } - }, "string": { "description": "APIString is a string response", "schema": { "type": "string" } - }, - "unauthorized": { - "description": "APIUnauthorizedError is an unauthorized error response", - "headers": { - "message": { - "type": "string" - }, - "url": { - "type": "string" - } - } - }, - "validationError": { - "description": "APIValidationError is error format response related to input validation", - "headers": { - "message": { - "type": "string" - }, - "url": { - "type": "string" - } - } } }, "securityDefinitions": {