summaryrefslogtreecommitdiffstats
path: root/templates/swagger
diff options
context:
space:
mode:
authorJakobDev <jakobdev@gmx.de>2023-04-27 05:51:20 +0200
committerGitHub <noreply@github.com>2023-04-27 11:51:20 +0800
commit36a5d4c2f3b5670e5e921034cd5d25817534a6d4 (patch)
tree373c7b9bdfa4bdaaf1552dcbe1094723d2bd7b09 /templates/swagger
parent50133b02bd381b7ee4da1ec4b7b637d5b7552678 (diff)
downloadgitea-36a5d4c2f3b5670e5e921034cd5d25817534a6d4.tar.gz
gitea-36a5d4c2f3b5670e5e921034cd5d25817534a6d4.zip
Add API for gitignore templates (#22783)
This implements the [Gitignores template API of GitHub](https://docs.github.com/en/rest/gitignore?apiVersion=2022-11-28) in Gitea
Diffstat (limited to 'templates/swagger')
-rw-r--r--templates/swagger/v1_json.tmpl76
1 files changed, 76 insertions, 0 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index 19b5179927..2db950b57a 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -883,6 +883,52 @@
}
}
},
+ "/gitignore/templates": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "miscellaneous"
+ ],
+ "summary": "Returns a list of all gitignore templates",
+ "operationId": "listGitignoresTemplates",
+ "responses": {
+ "200": {
+ "$ref": "#/responses/GitignoreTemplateList"
+ }
+ }
+ }
+ },
+ "/gitignore/templates/{name}": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "miscellaneous"
+ ],
+ "summary": "Returns information about a gitignore template",
+ "operationId": "getGitignoreTemplateInfo",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "name of the template",
+ "name": "name",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/GitignoreTemplateInfo"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
"/licenses": {
"get": {
"produces": [
@@ -18342,6 +18388,21 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "GitignoreTemplateInfo": {
+ "description": "GitignoreTemplateInfo name and text of a gitignore template",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "x-go-name": "Name"
+ },
+ "source": {
+ "type": "string",
+ "x-go-name": "Source"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"Hook": {
"description": "Hook a hook is a web hook when one repository changed",
"type": "object",
@@ -21614,6 +21675,21 @@
"$ref": "#/definitions/GitTreeResponse"
}
},
+ "GitignoreTemplateInfo": {
+ "description": "GitignoreTemplateInfo",
+ "schema": {
+ "$ref": "#/definitions/GitignoreTemplateInfo"
+ }
+ },
+ "GitignoreTemplateList": {
+ "description": "GitignoreTemplateList",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
"Hook": {
"description": "Hook",
"schema": {