From cea79227c28b8bb5b4f424c2c9c2cc7d93d0c386 Mon Sep 17 00:00:00 2001 From: Karan Saraswat Date: Fri, 20 Sep 2024 09:32:48 +0000 Subject: [PATCH] feat: [CODE-2370]: updated errors for restore/delete PR source branch API in swagger (#2714) * fixed op name * feat: [CODE-2370]: updated errors for restore/delete PR source branch API in swagger --- app/api/openapi/pullreq.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/api/openapi/pullreq.go b/app/api/openapi/pullreq.go index f20d80636..40a212e65 100644 --- a/app/api/openapi/pullreq.go +++ b/app/api/openapi/pullreq.go @@ -714,6 +714,7 @@ func pullReqOperations(reflector *openapi3.Reflector) { _ = reflector.SetJSONResponse(&opRestoreBranch, new(usererror.Error), http.StatusInternalServerError) _ = reflector.SetJSONResponse(&opRestoreBranch, new(usererror.Error), http.StatusUnauthorized) _ = reflector.SetJSONResponse(&opRestoreBranch, new(usererror.Error), http.StatusForbidden) + _ = reflector.SetJSONResponse(&opRestoreBranch, new(usererror.Error), http.StatusConflict) _ = reflector.SetJSONResponse(&opRestoreBranch, new(types.RulesViolations), http.StatusUnprocessableEntity) _ = reflector.Spec.AddOperation(http.MethodPost, "/repos/{repo_ref}/pullreq/{pullreq_number}/branch", opRestoreBranch) @@ -727,6 +728,7 @@ func pullReqOperations(reflector *openapi3.Reflector) { _ = reflector.SetJSONResponse(&opDeleteBranch, new(usererror.Error), http.StatusUnauthorized) _ = reflector.SetJSONResponse(&opDeleteBranch, new(usererror.Error), http.StatusForbidden) _ = reflector.SetJSONResponse(&opDeleteBranch, new(usererror.Error), http.StatusNotFound) + _ = reflector.SetJSONResponse(&opDeleteBranch, new(usererror.Error), http.StatusConflict) _ = reflector.SetJSONResponse(&opDeleteBranch, new(types.RulesViolations), http.StatusUnprocessableEntity) _ = reflector.Spec.AddOperation(http.MethodDelete, "/repos/{repo_ref}/pullreq/{pullreq_number}/branch", opDeleteBranch)