From 9f4e45be74109cbe133cf758d251a67148dc4792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Ga=C4=87e=C5=A1a?= Date: Wed, 17 May 2023 13:40:29 +0200 Subject: [PATCH] fix swagger reviewer API response --- internal/api/openapi/pullreq.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/api/openapi/pullreq.go b/internal/api/openapi/pullreq.go index 14eff0e04..0b9817847 100644 --- a/internal/api/openapi/pullreq.go +++ b/internal/api/openapi/pullreq.go @@ -384,7 +384,7 @@ func pullReqOperations(reflector *openapi3.Reflector) { reviewerAdd.WithTags("pullreq") reviewerAdd.WithMapOfAnything(map[string]interface{}{"operationId": "reviewerAddPullReq"}) _ = reflector.SetRequest(&reviewerAdd, new(reviewerAddPullReqRequest), http.MethodPut) - _ = reflector.SetJSONResponse(&reviewerAdd, nil, http.StatusNoContent) + _ = reflector.SetJSONResponse(&reviewerAdd, new(types.PullReqReviewer), http.StatusOK) _ = reflector.SetJSONResponse(&reviewerAdd, new(usererror.Error), http.StatusBadRequest) _ = reflector.SetJSONResponse(&reviewerAdd, new(usererror.Error), http.StatusInternalServerError) _ = reflector.SetJSONResponse(&reviewerAdd, new(usererror.Error), http.StatusUnauthorized) @@ -396,7 +396,7 @@ func pullReqOperations(reflector *openapi3.Reflector) { reviewerList.WithTags("pullreq") reviewerList.WithMapOfAnything(map[string]interface{}{"operationId": "reviewerListPullReq"}) _ = reflector.SetRequest(&reviewerList, new(reviewerListPullReqRequest), http.MethodGet) - _ = reflector.SetJSONResponse(&reviewerList, nil, http.StatusNoContent) + _ = reflector.SetJSONResponse(&reviewerList, new([]*types.PullReqReviewer), http.StatusOK) _ = reflector.SetJSONResponse(&reviewerList, new(usererror.Error), http.StatusBadRequest) _ = reflector.SetJSONResponse(&reviewerList, new(usererror.Error), http.StatusInternalServerError) _ = reflector.SetJSONResponse(&reviewerList, new(usererror.Error), http.StatusUnauthorized)