summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorJason Song <i@wolfogre.com>2022-11-19 23:22:15 +0800
committerGitHub <noreply@github.com>2022-11-19 15:22:15 +0000
commitd3f850cc0e791fa5ee5b25d824c475505fc12444 (patch)
tree67dd48f57356446fb2de93ca149e2c04f2ccc74f /templates
parentc8f3eb6acbf16b9f2e74fa2bfabb384359fbadd8 (diff)
downloadgitea-d3f850cc0e791fa5ee5b25d824c475505fc12444.tar.gz
gitea-d3f850cc0e791fa5ee5b25d824c475505fc12444.zip
Support comma-delimited string as labels in issue template (#21831)
The [labels in issue YAML templates](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax) can be a string array or a comma-delimited string, so a single string should be valid labels. The old codes committed in #20987 ignore this, that's why the warning is displayed: <img width="618" alt="image" src="https://user-images.githubusercontent.com/9418365/202112642-93dc72d0-71c3-40a2-9720-30fc2d48c97c.png"> Fixes #17877.
Diffstat (limited to 'templates')
-rw-r--r--templates/swagger/v1_json.tmpl13
1 files changed, 8 insertions, 5 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index fe3185ea77..ddafc146a1 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -16818,11 +16818,7 @@
"x-go-name": "FileName"
},
"labels": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "x-go-name": "Labels"
+ "$ref": "#/definitions/IssueTemplateLabels"
},
"name": {
"type": "string",
@@ -16839,6 +16835,13 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "IssueTemplateLabels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"Label": {
"description": "Label a label to an issue or a pr",
"type": "object",