diff options
author | a1012112796 <1012112796@qq.com> | 2021-07-05 23:29:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-05 17:29:08 +0200 |
commit | 5bb97a12d79309e799e9826badf3527f03815dd2 (patch) | |
tree | 35e6a708ca49a01684ea97512055c0611552e7f4 /templates/swagger | |
parent | 64122fe105686502d4d5606425875a6b16fa6203 (diff) | |
download | gitea-5bb97a12d79309e799e9826badf3527f03815dd2.tar.gz gitea-5bb97a12d79309e799e9826badf3527f03815dd2.zip |
Creating a repo from a template repo via API (#15958)
* Creating a repo from a template repo via API
fix #15934
ref:
https://docs.github.com/en/rest/reference/repos#create-a-repository-using-a-template
Signed-off-by: a1012112796 <1012112796@qq.com>
Diffstat (limited to 'templates/swagger')
-rw-r--r-- | templates/swagger/v1_json.tmpl | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index a2e449228e..669e3552cc 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -9777,6 +9777,61 @@ } } }, + "/repos/{template_owner}/{template_repo}/generate": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Create a repository using a template", + "operationId": "generateRepo", + "parameters": [ + { + "type": "string", + "description": "name of the template repository owner", + "name": "template_owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the template repository", + "name": "template_repo", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/GenerateRepoOption" + } + } + ], + "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" + } + } + } + }, "/repositories/{id}": { "get": { "produces": [ @@ -14551,6 +14606,68 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "GenerateRepoOption": { + "description": "GenerateRepoOption options when creating repository using a template", + "type": "object", + "required": [ + "owner", + "name" + ], + "properties": { + "avatar": { + "description": "include avatar of the template repo", + "type": "boolean", + "x-go-name": "Avatar" + }, + "description": { + "description": "Description of the repository to create", + "type": "string", + "x-go-name": "Description" + }, + "git_content": { + "description": "include git content of default branch in template repo", + "type": "boolean", + "x-go-name": "GitContent" + }, + "git_hooks": { + "description": "include git hooks in template repo", + "type": "boolean", + "x-go-name": "GitHooks" + }, + "labels": { + "description": "include labels in template repo", + "type": "boolean", + "x-go-name": "Labels" + }, + "name": { + "description": "Name of the repository to create", + "type": "string", + "uniqueItems": true, + "x-go-name": "Name" + }, + "owner": { + "description": "The organization or person who will own the new repository", + "type": "string", + "x-go-name": "Owner" + }, + "private": { + "description": "Whether the repository is private", + "type": "boolean", + "x-go-name": "Private" + }, + "topics": { + "description": "include topics in template repo", + "type": "boolean", + "x-go-name": "Topics" + }, + "webhooks": { + "description": "include webhooks in template repo", + "type": "boolean", + "x-go-name": "Webhooks" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "GitBlobResponse": { "description": "GitBlobResponse represents a git blob", "type": "object", |