{ "swagger": "2.0", "info": { "title": "CNB OPENAPI", "contact": { "name": "Open API Support", "url": "https://docs.cnb.cool/", "email": "cnb@tencent.com" }, "version": "1.0" }, "paths": { "/{repo}/-/files/{filePath}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "删除 UploadFiles 上传的附件\n访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-manage:rw", "tags": [ "Pulls", "Issues" ], "summary": "删除 UploadFiles 上传的附件", "operationId": "DeleteRepoFiles", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "文件访问链接的files后半部分,比如链接是 https://cnb.cool/cnb/feedback/-/files/abc/1234abcd/test.zip,filePath 就是 abc/1234abcd/test.zip", "name": "filePath", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" } } } }, "/{repo}/-/imgs/{imgPath}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "删除 UploadImgs 上传的图片\n访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-manage:rw", "tags": [ "Pulls", "Issues" ], "summary": "删除 UploadImgs 上传的图片", "operationId": "DeleteRepoImgs", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "图片访问链接的imgs后半部分,比如链接是 https://cnb.cool/cnb/feedback/-/imgs/abc/1234abcd.png,imgPath 就是 abc/1234abcd.png", "name": "imgPath", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" } } } }, "/{repo}/-/pull-in-batch": { "get": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "根据 number 列表查询合并请求列表。List pull requests by numbers.", "operationId": "ListPullsByNumbers", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "array", "items": { "type": "integer" }, "collectionFormat": "csv", "description": "pull request numbers", "name": "n", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/api.PullRequestInfo" } } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-pr:r" } }, "/{repo}/-/pulls": { "get": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "查询合并请求列表。List pull requests.", "operationId": "ListPulls", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "default": 1, "description": "pagination page number", "name": "page", "in": "query" }, { "type": "integer", "default": 30, "description": "pagination page size", "name": "page_size", "in": "query" }, { "type": "string", "default": "open", "description": "pull state `open`,`closed`, `all`", "name": "state", "in": "query" }, { "type": "string", "description": "pull authors name, example: 张三,李四", "name": "authors", "in": "query" }, { "type": "string", "description": "pull reviewers name, example: 张三,李四; - means nobody to review", "name": "reviewers", "in": "query" }, { "type": "string", "description": "pull assignees name, example: 张三,李四,-; - means assign to nobody", "name": "assignees", "in": "query" }, { "type": "string", "description": "pull labels example: git,bug,feature", "name": "labels", "in": "query" }, { "type": "string", "description": "pull labels operator example: contains_any,contains_all default: contains_any", "name": "labels_operator", "in": "query" }, { "type": "string", "description": "pull base ref, example: refs/heads/master", "name": "base_ref", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/api.PullRequest" } } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-pr:r" }, "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "新增一个合并请求。Create a pull request.", "operationId": "PostPull", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "description": "Post Pull Request Form", "name": "post_pull_form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.PullCreationForm" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/api.Pull" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-pr:rw" } }, "/{repo}/-/pulls/{number}": { "get": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "查询指定合并请求。Get a pull request.", "operationId": "GetPull", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "pull request number", "name": "number", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.Pull" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-pr:r" }, "patch": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "更新一个合并请求。Update a pull request.", "operationId": "PatchPull", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "Pull Request Number", "name": "number", "in": "path", "required": true }, { "description": "Update Pull Request Form", "name": "update_pull_request_form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.PatchPullRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.Pull" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-pr:rw" } }, "/{repo}/-/pulls/{number}/assignees": { "get": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "查询指定合并请求的处理人。List repository pull request assignees.", "operationId": "ListPullAssignees", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "pull request number", "name": "number", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/git_woa_com_cnb_monorepo_git_internal_app_git_service_bff_api.UserInfo" } } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:r" }, "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "添加处理人到指定的合并请求。 Adds up to assignees to a pull request. Users already assigned to an issue are not replaced.", "operationId": "PostPullAssignees", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "number", "name": "number", "in": "path", "required": true }, { "description": "Post Pull Assignees Form", "name": "post_pull_assignees_form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.PostPullAssigneesForm" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/api.Pull" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:rw" }, "delete": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "删除合并请求中的处理人 Removes one or more assignees from a pull request.", "operationId": "DeletePullAssignees", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "number", "name": "number", "in": "path", "required": true }, { "description": "Delete Pull Assignees Form", "name": "delete_pull_assignees_form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.DeletePullAssigneesForm" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.Pull" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:rw" } }, "/{repo}/-/pulls/{number}/assignees/{assignee}": { "get": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "检查用户是否可以被添加到合并请求的处理人中。 Checks if a user can be assigned to a pull request.", "operationId": "CanUserBeAssignedToPull", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "number", "name": "number", "in": "path", "required": true }, { "type": "string", "description": "assignee", "name": "assignee", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:r" } }, "/{repo}/-/pulls/{number}/comments": { "get": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "查询合并请求评论列表。List pull comments requests.", "operationId": "ListPullComments", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "number", "name": "number", "in": "path", "required": true }, { "type": "integer", "default": 1, "description": "pagination page number", "name": "page", "in": "query" }, { "type": "integer", "default": 30, "description": "pagination page size", "name": "page_size", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/api.PullRequestComment" } } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:r" }, "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "新增一个合并请求评论。Create a pull comment.", "operationId": "PostPullComment", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "number", "name": "number", "in": "path", "required": true }, { "description": "Post Pull Request Comment Form", "name": "post_pull_comment_form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.PullCommentCreationForm" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/api.PullRequestComment" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:rw" } }, "/{repo}/-/pulls/{number}/comments/{comment_id}": { "get": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "获取一个合并请求评论。Get a pull comment.", "operationId": "GetPullComment", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "number", "name": "number", "in": "path", "required": true }, { "type": "integer", "description": "comment_id", "name": "comment_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.PullRequestComment" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:r" }, "patch": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "更新一个合并请求评论。Update a pull comment.", "operationId": "PatchPullComment", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "number", "name": "number", "in": "path", "required": true }, { "type": "integer", "description": "comment_id", "name": "comment_id", "in": "path", "required": true }, { "description": "Patch Pull Comment Form", "name": "patch_pull_comment_form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.PatchPullCommentForm" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.PullRequestComment" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:rw" } }, "/{repo}/-/pulls/{number}/commit-statuses": { "get": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "查询 Pull Request 的状态检查", "operationId": "ListPullCommitStatuses", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "pull number", "name": "number", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.CommitStatuses" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-pr:r" } }, "/{repo}/-/pulls/{number}/commits": { "get": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "查询指定合并请求的提交列表。Lists the commits in a specified pull request.", "operationId": "ListPullCommits", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "pull request number", "name": "number", "in": "path", "required": true }, { "type": "integer", "default": 1, "description": "pagination page number", "name": "page", "in": "query" }, { "type": "integer", "default": 30, "description": "pagination page size", "name": "page_size", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/api.Commit" } } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:r" } }, "/{repo}/-/pulls/{number}/files": { "get": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "查询指定合并请求的文件列表。Lists the files in a specified pull request.", "operationId": "ListPullFiles", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "pull request number", "name": "number", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/api.PullFile" } } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:r" } }, "/{repo}/-/pulls/{number}/labels": { "get": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "查询指定合并请求的标签列表。List labels for a pull.", "operationId": "ListPullLabels", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "number", "name": "number", "in": "path", "required": true }, { "type": "integer", "default": 1, "description": "pagination page number", "name": "page", "in": "query" }, { "type": "integer", "default": 30, "description": "pagination page size", "name": "page_size", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/api.Label" } } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:r" }, "put": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "设置合并请求标签。Set the new labels for a pull.", "operationId": "PutPullLabels", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "number", "name": "number", "in": "path", "required": true }, { "description": "Put Pull Labels Form", "name": "put_pull_labels_form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.PutPullLabelsForm" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.Label" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:rw" }, "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "新增合并请求标签。Add labels to a pull.", "operationId": "PostPullLabels", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "number", "name": "number", "in": "path", "required": true }, { "description": "Post Pull Labels Form", "name": "post_pull_labels_form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.PostPullLabelsForm" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.Label" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:rw" }, "delete": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "清空合并请求标签。Remove all labels from a pull.", "operationId": "DeletePullLabels", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "number", "name": "number", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:rw" } }, "/{repo}/-/pulls/{number}/labels/{name}": { "delete": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "删除合并请求标签。Remove a label from a pull.", "operationId": "DeletePullLabel", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "number", "name": "number", "in": "path", "required": true }, { "type": "string", "description": "label name", "name": "name", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.Label" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:rw" } }, "/{repo}/-/pulls/{number}/merge": { "put": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "合并一个合并请求。Merge a pull request.", "operationId": "MergePull", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "Pull Request Number", "name": "number", "in": "path", "required": true }, { "description": "Merge Pull Request Form", "name": "merge_pull_request_form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.MergePullRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.MergePullResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-pr:rw" } }, "/{repo}/-/pulls/{number}/reviews": { "get": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "查询特定合并请求的评审列表。List pull reviews.", "operationId": "ListPullReviews", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "number", "name": "number", "in": "path", "required": true }, { "type": "integer", "default": 1, "description": "pagination page number", "name": "page", "in": "query" }, { "type": "integer", "default": 30, "description": "pagination page size", "name": "page_size", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/api.PullReview" } } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/die.WebError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:r" }, "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "新增一次合并请求评审。Create a pull review.", "operationId": "PostPullReview", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "number", "name": "number", "in": "path", "required": true }, { "description": "Post Pull Review Form", "name": "post_pull_review_form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.PullReviewCreationForm" } } ], "responses": { "201": { "description": "Created" }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/die.WebError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:rw" } }, "/{repo}/-/pulls/{number}/reviews/{review_id}/comments": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/vnd.cnb.api+json" ], "tags": [ "Pulls" ], "summary": "查询指定合并请求评审评论列表。List pull review comments.", "operationId": "ListPullReviewComments", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "pull request number", "name": "number", "in": "path", "required": true }, { "type": "integer", "description": "pull request review id", "name": "review_id", "in": "path", "required": true }, { "type": "integer", "default": 1, "description": "pagination page number", "name": "page", "in": "query" }, { "type": "integer", "default": 30, "description": "pagination page size", "name": "page_size", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/api.PullReviewComment" } } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/die.WebError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/die.WebError" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:r" } }, "/{repo}/-/upload/files": { "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Pulls", "Issues" ], "summary": "发起一个上传 files 的请求,返回上传文件的url,请使用 put 发起流式上传。Initiate a request to upload files,returns upload URL.Use PUT to initiate a stream upload.", "operationId": "UploadFiles", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "description": "UploadRequestParams", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.UploadRequestParams" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/dto.UploadAssetsResponse" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-contents:rw" } }, "/{repo}/-/upload/imgs": { "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Pulls", "Issues" ], "summary": "发起一个上传 imgs 的请求,返回上传文件的url,请使用 put 发起流式上传。Initiate a request to upload images,returns upload URL.Use PUT to initiate a stream upload.", "operationId": "UploadImgs", "parameters": [ { "type": "string", "description": "repo", "name": "repo", "in": "path", "required": true }, { "description": "UploadRequestParams", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.UploadRequestParams" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/dto.UploadAssetsResponse" } } }, "description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-contents:rw" } } }, "definitions": { "api.PullRequestInfo": { "type": "object", "properties": { "assignees": { "type": "array", "items": { "$ref": "#/definitions/git_woa_com_cnb_monorepo_git_internal_app_vcs_service_bff_api.UserInfo" } }, "author": { "$ref": "#/definitions/git_woa_com_cnb_monorepo_git_internal_app_vcs_service_bff_api.UserInfo" }, "base": { "$ref": "#/definitions/api.PullRefInfo" }, "blocked_on": { "type": "string" }, "created_at": { "type": "string" }, "head": { "$ref": "#/definitions/api.PullRefInfo" }, "labels": { "type": "array", "items": { "$ref": "#/definitions/api.Label" } }, "last_acted_at": { "type": "string" }, "mergeable_state": { "type": "string" }, "merged_by": { "$ref": "#/definitions/git_woa_com_cnb_monorepo_git_internal_app_vcs_service_bff_api.UserInfo" }, "number": { "type": "string" }, "repo": { "$ref": "#/definitions/api.RepoInfo" }, "reviewers": { "type": "array", "items": { "$ref": "#/definitions/git_woa_com_cnb_monorepo_git_internal_app_vcs_service_bff_api.UserInfo" } }, "state": { "type": "string" }, "title": { "type": "string" }, "updated_at": { "type": "string" } } }, "die.WebError": { "type": "object", "properties": { "errcode": { "type": "integer" }, "errmsg": { "type": "string" }, "errparam": { "type": "object", "additionalProperties": {} } } }, "api.PullRequest": { "type": "object", "properties": { "assignees": { "type": "array", "items": { "$ref": "#/definitions/git_woa_com_cnb_monorepo_git_internal_app_git_service_bff_api.UserInfo" } }, "author": { "$ref": "#/definitions/git_woa_com_cnb_monorepo_git_internal_app_git_service_bff_api.UserInfo" }, "base": { "$ref": "#/definitions/api.PullRef" }, "blocked_on": { "type": "string" }, "comment_count": { "type": "integer" }, "created_at": { "type": "string" }, "head": { "$ref": "#/definitions/api.PullRef" }, "is_wip": { "type": "boolean" }, "labels": { "type": "array", "items": { "$ref": "#/definitions/api.Label" } }, "last_acted_at": { "type": "string" }, "mergeable_state": { "type": "string" }, "merged_by": { "$ref": "#/definitions/git_woa_com_cnb_monorepo_git_internal_app_git_service_bff_api.UserInfo" }, "number": { "type": "string" }, "repo": { "$ref": "#/definitions/api.Repo" }, "review_count": { "type": "integer" }, "state": { "type": "string" }, "title": { "type": "string" }, "updated_at": { "type": "string" } } }, "api.PullCreationForm": { "type": "object", "properties": { "base": { "type": "string" }, "body": { "type": "string" }, "head": { "type": "string" }, "head_repo": { "type": "string" }, "title": { "type": "string" } } }, "api.Pull": { "type": "object", "properties": { "base": { "$ref": "#/definitions/api.PullRef" }, "blocked_on": { "type": "string" }, "body": { "type": "string" }, "head": { "$ref": "#/definitions/api.PullRef" }, "is_wip": { "type": "boolean" }, "labels": { "type": "array", "items": { "$ref": "#/definitions/api.Label" } }, "merged_by": { "$ref": "#/definitions/git_woa_com_cnb_monorepo_git_internal_app_git_service_bff_api.UserInfo" }, "number": { "type": "string" }, "reviewers": { "type": "array", "items": { "$ref": "#/definitions/api.PullReviewer" } }, "state": { "type": "string" }, "title": { "type": "string" } } }, "api.PatchPullRequest": { "type": "object", "properties": { "body": { "type": "string" }, "state": { "description": "State of this Pull Request. Either `open` or `closed`.", "type": "string" }, "title": { "type": "string" } } }, "git_woa_com_cnb_monorepo_git_internal_app_git_service_bff_api.UserInfo": { "type": "object", "properties": { "email": { "description": "用户邮箱。", "type": "string" }, "freeze": { "description": "是否冻结。", "type": "boolean" }, "nickname": { "description": "昵称。", "type": "string" }, "username": { "description": "用户名。", "type": "string" } } }, "api.PostPullAssigneesForm": { "type": "object", "properties": { "assignees": { "type": "array", "items": { "type": "string" } } } }, "api.DeletePullAssigneesForm": { "type": "object", "properties": { "assignees": { "type": "array", "items": { "type": "string" } } } }, "api.PullRequestComment": { "type": "object", "properties": { "author": { "$ref": "#/definitions/git_woa_com_cnb_monorepo_git_internal_app_git_service_bff_api.UserInfo" }, "body": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "string" }, "updated_at": { "type": "string" } } }, "api.PullCommentCreationForm": { "type": "object", "properties": { "body": { "type": "string" } } }, "api.PatchPullCommentForm": { "type": "object", "properties": { "body": { "type": "string" } } }, "api.CommitStatuses": { "type": "object", "properties": { "sha": { "type": "string" }, "state": { "type": "string" }, "statuses": { "type": "array", "items": { "$ref": "#/definitions/git_woa_com_cnb_monorepo_git_internal_app_vcs_service_bff_api.CommitStatus" } } } }, "api.Commit": { "type": "object", "properties": { "author": { "description": "提交的作者信息。", "allOf": [ { "$ref": "#/definitions/git_woa_com_cnb_monorepo_git_internal_app_git_service_bff_api.UserInfo" } ] }, "commit": { "description": "提交的详细信息。", "allOf": [ { "$ref": "#/definitions/api.CommitObject" } ] }, "committer": { "description": "提交的提交者信息。", "allOf": [ { "$ref": "#/definitions/git_woa_com_cnb_monorepo_git_internal_app_git_service_bff_api.UserInfo" } ] }, "parents": { "description": "父提交列表。", "type": "array", "items": { "$ref": "#/definitions/api.CommitParent" } }, "sha": { "description": "提交的哈希值。", "type": "string" } } }, "api.PullFile": { "type": "object", "properties": { "additions": { "type": "integer" }, "blob_url": { "type": "string" }, "contents_url": { "type": "string" }, "deletions": { "type": "integer" }, "filename": { "type": "string" }, "patch": { "type": "string" }, "raw_url": { "type": "string" }, "sha": { "type": "string" }, "status": { "description": "Status of this Pull Request specified diff file. Either `add` / `modify` / `delete` / `rename` / `copy`.", "type": "string" } } }, "api.Label": { "type": "object", "properties": { "color": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" } } }, "api.PutPullLabelsForm": { "type": "object", "properties": { "labels": { "type": "array", "items": { "type": "string" } } } }, "api.PostPullLabelsForm": { "type": "object", "properties": { "labels": { "type": "array", "items": { "type": "string" } } } }, "api.MergePullRequest": { "type": "object", "properties": { "commit_message": { "type": "string" }, "commit_title": { "type": "string" }, "merge_style": { "description": "The merge method to use. Can be one of: `merge`, `squash`, `rebase`", "type": "string" } } }, "api.MergePullResponse": { "type": "object", "properties": { "merged": { "type": "boolean" }, "message": { "type": "string" }, "sha": { "type": "string" } } }, "api.PullReview": { "type": "object", "properties": { "author": { "$ref": "#/definitions/git_woa_com_cnb_monorepo_git_internal_app_git_service_bff_api.UserInfo" }, "body": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "string" }, "state": { "type": "string" }, "updated_at": { "type": "string" } } }, "api.PullReviewCreationForm": { "type": "object", "properties": { "body": { "type": "string" }, "comments": { "type": "array", "items": { "$ref": "#/definitions/api.PullReviewCommentCreationForm" } }, "event": { "type": "string" } } }, "api.PullReviewComment": { "type": "object", "properties": { "author": { "$ref": "#/definitions/git_woa_com_cnb_monorepo_git_internal_app_git_service_bff_api.UserInfo" }, "body": { "type": "string" }, "commit_hash": { "type": "string" }, "created_at": { "type": "string" }, "diff_hunk": { "type": "array", "items": { "$ref": "#/definitions/api.DiffLine" } }, "end_line": { "type": "integer" }, "end_side": { "type": "string" }, "id": { "type": "string" }, "path": { "type": "string" }, "reply_to_comment_id": { "type": "string" }, "review_id": { "type": "string" }, "review_state": { "type": "string" }, "start_line": { "type": "integer" }, "start_side": { "type": "string" }, "subject_type": { "type": "string" }, "updated_at": { "type": "string" } } }, "dto.UploadRequestParams": { "type": "object", "properties": { "ext": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "size": { "type": "integer" } } }, "dto.UploadAssetsResponse": { "type": "object", "properties": { "assets": { "$ref": "#/definitions/dto.Assets" }, "form": { "type": "object", "additionalProperties": { "type": "string" } }, "token": { "description": "后续调用 confirm 接口用的", "type": "string" }, "upload_url": { "type": "string" } } }, "git_woa_com_cnb_monorepo_git_internal_app_vcs_service_bff_api.UserInfo": { "type": "object", "properties": { "nickname": { "type": "string" }, "username": { "type": "string" } } }, "api.PullRefInfo": { "type": "object", "properties": { "ref": { "type": "string" }, "repo": { "$ref": "#/definitions/api.RepoInfo" }, "sha": { "type": "string" } } }, "api.RepoInfo": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "path": { "type": "string" }, "web_url": { "type": "string" } } }, "api.PullRef": { "type": "object", "properties": { "ref": { "type": "string" }, "repo": { "$ref": "#/definitions/api.Repo" }, "sha": { "type": "string" } } }, "api.Repo": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "path": { "type": "string" }, "web_url": { "type": "string" } } }, "dto.Assets": { "type": "object", "properties": { "content_type": { "type": "string" }, "ext": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "path": { "type": "string", "example": "/{slug}/-/assets/xxx/xxx/xxxx-xxx.png" }, "size": { "type": "integer" } } } } }