Add API for Label templates (#24602)

This adds API that allows getting the Label templates of the Gitea
Instance
This commit is contained in:
JakobDev
2023-05-23 12:10:23 +02:00
committed by GitHub
parent abcf5a7b5e
commit 25dc1556cd
7 changed files with 258 additions and 0 deletions

View File

@ -929,6 +929,52 @@
}
}
},
"/label/templates": {
"get": {
"produces": [
"application/json"
],
"tags": [
"miscellaneous"
],
"summary": "Returns a list of all label templates",
"operationId": "listLabelTemplates",
"responses": {
"200": {
"$ref": "#/responses/LabelTemplateList"
}
}
}
},
"/label/templates/{name}": {
"get": {
"produces": [
"application/json"
],
"tags": [
"miscellaneous"
],
"summary": "Returns all labels in a template",
"operationId": "getLabelTemplateInfo",
"parameters": [
{
"type": "string",
"description": "name of the template",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/LabelTemplateInfo"
},
"404": {
"$ref": "#/responses/notFound"
}
}
}
},
"/licenses": {
"get": {
"produces": [
@ -18858,6 +18904,31 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"LabelTemplate": {
"description": "LabelTemplate info of a Label template",
"type": "object",
"properties": {
"color": {
"type": "string",
"x-go-name": "Color",
"example": "00aabb"
},
"description": {
"type": "string",
"x-go-name": "Description"
},
"exclusive": {
"type": "boolean",
"x-go-name": "Exclusive",
"example": false
},
"name": {
"type": "string",
"x-go-name": "Name"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"LicenseTemplateInfo": {
"description": "LicensesInfo contains information about a License",
"type": "object",
@ -21797,6 +21868,24 @@
}
}
},
"LabelTemplateInfo": {
"description": "LabelTemplateInfo",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/LabelTemplate"
}
}
},
"LabelTemplateList": {
"description": "LabelTemplateList",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
"LanguageStatistics": {
"description": "LanguageStatistics",
"schema": {