1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

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
This commit is contained in:
JakobDev
2023-04-27 05:51:20 +02:00
committed by GitHub
parent 50133b02bd
commit 36a5d4c2f3
6 changed files with 207 additions and 0 deletions

View File

@@ -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": {