diff options
author | 6543 <6543@obermui.de> | 2020-05-02 02:20:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-02 03:20:51 +0300 |
commit | c97494a4f4a0e8ba5453e293bcebb76274062b99 (patch) | |
tree | 29511446fbdc0296f77390a6566d4ad1eef4668c /routers/api/v1/swagger | |
parent | 4ed7d2a2bbb421e37cc0bc23a9f997e5606258ea (diff) | |
download | gitea-c97494a4f4a0e8ba5453e293bcebb76274062b99.tar.gz gitea-c97494a4f4a0e8ba5453e293bcebb76274062b99.zip |
API: Add pull review endpoints (#11224)
* API: Added pull review read only endpoints
* Update Structs, move Conversion, Refactor
* refactor
* lint & co
* fix lint + refactor
* add new Review state, rm unessesary, refacotr loadAttributes, convert patch to diff
* add DeletePullReview
* add paggination
* draft1: Create & submit review
* fix lint
* fix lint
* impruve test
* DONT use GhostUser for loadReviewer
* expose comments_count of a PullReview
* infent GetCodeCommentsCount()
* fixes
* fix+impruve
* some nits
* Handle Ghosts :ghost:
* add TEST for GET apis
* complete TESTS
* add HTMLURL to PullReview responce
* code format as per @lafriks
* update swagger definition
* Update routers/api/v1/repo/pull_review.go
Co-authored-by: David Svantesson <davidsvantesson@gmail.com>
* add comments
Co-authored-by: Thomas Berger <loki@lokis-chaos.de>
Co-authored-by: David Svantesson <davidsvantesson@gmail.com>
Diffstat (limited to 'routers/api/v1/swagger')
-rw-r--r-- | routers/api/v1/swagger/options.go | 9 | ||||
-rw-r--r-- | routers/api/v1/swagger/repo.go | 52 |
2 files changed, 49 insertions, 12 deletions
diff --git a/routers/api/v1/swagger/options.go b/routers/api/v1/swagger/options.go index 4bb649616a..f13dc63864 100644 --- a/routers/api/v1/swagger/options.go +++ b/routers/api/v1/swagger/options.go @@ -137,4 +137,13 @@ type swaggerParameterBodies struct { // in:body CreateOAuth2ApplicationOptions api.CreateOAuth2ApplicationOptions + + // in:body + CreatePullReviewOptions api.CreatePullReviewOptions + + // in:body + CreatePullReviewComment api.CreatePullReviewComment + + // in:body + SubmitPullReviewOptions api.SubmitPullReviewOptions } diff --git a/routers/api/v1/swagger/repo.go b/routers/api/v1/swagger/repo.go index 2a657f3122..bcbc2b5fa9 100644 --- a/routers/api/v1/swagger/repo.go +++ b/routers/api/v1/swagger/repo.go @@ -141,6 +141,34 @@ type swaggerResponsePullRequestList struct { Body []api.PullRequest `json:"body"` } +// PullReview +// swagger:response PullReview +type swaggerResponsePullReview struct { + // in:body + Body api.PullReview `json:"body"` +} + +// PullReviewList +// swagger:response PullReviewList +type swaggerResponsePullReviewList struct { + // in:body + Body []api.PullReview `json:"body"` +} + +// PullComment +// swagger:response PullReviewComment +type swaggerPullReviewComment struct { + // in:body + Body api.PullReviewComment `json:"body"` +} + +// PullCommentList +// swagger:response PullReviewCommentList +type swaggerResponsePullReviewCommentList struct { + // in:body + Body []api.PullReviewComment `json:"body"` +} + // Status // swagger:response Status type swaggerResponseStatus struct { @@ -172,35 +200,35 @@ type swaggerResponseSearchResults struct { // AttachmentList // swagger:response AttachmentList type swaggerResponseAttachmentList struct { - //in: body + // in: body Body []api.Attachment `json:"body"` } // Attachment // swagger:response Attachment type swaggerResponseAttachment struct { - //in: body + // in: body Body api.Attachment `json:"body"` } // GitTreeResponse // swagger:response GitTreeResponse type swaggerGitTreeResponse struct { - //in: body + // in: body Body api.GitTreeResponse `json:"body"` } // GitBlobResponse // swagger:response GitBlobResponse type swaggerGitBlobResponse struct { - //in: body + // in: body Body api.GitBlobResponse `json:"body"` } // Commit // swagger:response Commit type swaggerCommit struct { - //in: body + // in: body Body api.Commit `json:"body"` } @@ -222,28 +250,28 @@ type swaggerCommitList struct { // True if there is another page HasMore bool `json:"X-HasMore"` - //in: body + // in: body Body []api.Commit `json:"body"` } // EmptyRepository // swagger:response EmptyRepository type swaggerEmptyRepository struct { - //in: body + // in: body Body api.APIError `json:"body"` } // FileResponse // swagger:response FileResponse type swaggerFileResponse struct { - //in: body + // in: body Body api.FileResponse `json:"body"` } // ContentsResponse // swagger:response ContentsResponse type swaggerContentsResponse struct { - //in: body + // in: body Body api.ContentsResponse `json:"body"` } @@ -257,20 +285,20 @@ type swaggerContentsListResponse struct { // FileDeleteResponse // swagger:response FileDeleteResponse type swaggerFileDeleteResponse struct { - //in: body + // in: body Body api.FileDeleteResponse `json:"body"` } // TopicListResponse // swagger:response TopicListResponse type swaggerTopicListResponse struct { - //in: body + // in: body Body []api.TopicResponse `json:"body"` } // TopicNames // swagger:response TopicNames type swaggerTopicNames struct { - //in: body + // in: body Body api.TopicName `json:"body"` } |