mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Implement Issue Config (#20956)
Closes #20955 This PR adds the possibility to disable blank Issues, when the Repo has templates. This can be done by creating the file `.gitea/issue_config.yaml` with the content `blank_issues_enabled` in the Repo.
This commit is contained in:
		@@ -5013,6 +5013,72 @@
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "/repos/{owner}/{repo}/issue_config": {
 | 
			
		||||
      "get": {
 | 
			
		||||
        "produces": [
 | 
			
		||||
          "application/json"
 | 
			
		||||
        ],
 | 
			
		||||
        "tags": [
 | 
			
		||||
          "repository"
 | 
			
		||||
        ],
 | 
			
		||||
        "summary": "Returns the issue config for a repo",
 | 
			
		||||
        "operationId": "repoGetIssueConfig",
 | 
			
		||||
        "parameters": [
 | 
			
		||||
          {
 | 
			
		||||
            "type": "string",
 | 
			
		||||
            "description": "owner of the repo",
 | 
			
		||||
            "name": "owner",
 | 
			
		||||
            "in": "path",
 | 
			
		||||
            "required": true
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            "type": "string",
 | 
			
		||||
            "description": "name of the repo",
 | 
			
		||||
            "name": "repo",
 | 
			
		||||
            "in": "path",
 | 
			
		||||
            "required": true
 | 
			
		||||
          }
 | 
			
		||||
        ],
 | 
			
		||||
        "responses": {
 | 
			
		||||
          "200": {
 | 
			
		||||
            "$ref": "#/responses/RepoIssueConfig"
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "/repos/{owner}/{repo}/issue_config/validate": {
 | 
			
		||||
      "get": {
 | 
			
		||||
        "produces": [
 | 
			
		||||
          "application/json"
 | 
			
		||||
        ],
 | 
			
		||||
        "tags": [
 | 
			
		||||
          "repository"
 | 
			
		||||
        ],
 | 
			
		||||
        "summary": "Returns the validation information for a issue config",
 | 
			
		||||
        "operationId": "repoValidateIssueConfig",
 | 
			
		||||
        "parameters": [
 | 
			
		||||
          {
 | 
			
		||||
            "type": "string",
 | 
			
		||||
            "description": "owner of the repo",
 | 
			
		||||
            "name": "owner",
 | 
			
		||||
            "in": "path",
 | 
			
		||||
            "required": true
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            "type": "string",
 | 
			
		||||
            "description": "name of the repo",
 | 
			
		||||
            "name": "repo",
 | 
			
		||||
            "in": "path",
 | 
			
		||||
            "required": true
 | 
			
		||||
          }
 | 
			
		||||
        ],
 | 
			
		||||
        "responses": {
 | 
			
		||||
          "200": {
 | 
			
		||||
            "$ref": "#/responses/RepoIssueConfigValidation"
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "/repos/{owner}/{repo}/issue_templates": {
 | 
			
		||||
      "get": {
 | 
			
		||||
        "produces": [
 | 
			
		||||
@@ -18165,6 +18231,55 @@
 | 
			
		||||
      },
 | 
			
		||||
      "x-go-package": "code.gitea.io/gitea/modules/structs"
 | 
			
		||||
    },
 | 
			
		||||
    "IssueConfig": {
 | 
			
		||||
      "type": "object",
 | 
			
		||||
      "properties": {
 | 
			
		||||
        "blank_issues_enabled": {
 | 
			
		||||
          "type": "boolean",
 | 
			
		||||
          "x-go-name": "BlankIssuesEnabled"
 | 
			
		||||
        },
 | 
			
		||||
        "contact_links": {
 | 
			
		||||
          "type": "array",
 | 
			
		||||
          "items": {
 | 
			
		||||
            "$ref": "#/definitions/IssueConfigContactLink"
 | 
			
		||||
          },
 | 
			
		||||
          "x-go-name": "ContactLinks"
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      "x-go-package": "code.gitea.io/gitea/modules/structs"
 | 
			
		||||
    },
 | 
			
		||||
    "IssueConfigContactLink": {
 | 
			
		||||
      "type": "object",
 | 
			
		||||
      "properties": {
 | 
			
		||||
        "about": {
 | 
			
		||||
          "type": "string",
 | 
			
		||||
          "x-go-name": "About"
 | 
			
		||||
        },
 | 
			
		||||
        "name": {
 | 
			
		||||
          "type": "string",
 | 
			
		||||
          "x-go-name": "Name"
 | 
			
		||||
        },
 | 
			
		||||
        "url": {
 | 
			
		||||
          "type": "string",
 | 
			
		||||
          "x-go-name": "URL"
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      "x-go-package": "code.gitea.io/gitea/modules/structs"
 | 
			
		||||
    },
 | 
			
		||||
    "IssueConfigValidation": {
 | 
			
		||||
      "type": "object",
 | 
			
		||||
      "properties": {
 | 
			
		||||
        "message": {
 | 
			
		||||
          "type": "string",
 | 
			
		||||
          "x-go-name": "Message"
 | 
			
		||||
        },
 | 
			
		||||
        "valid": {
 | 
			
		||||
          "type": "boolean",
 | 
			
		||||
          "x-go-name": "Valid"
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      "x-go-package": "code.gitea.io/gitea/modules/structs"
 | 
			
		||||
    },
 | 
			
		||||
    "IssueDeadline": {
 | 
			
		||||
      "description": "IssueDeadline represents an issue deadline",
 | 
			
		||||
      "type": "object",
 | 
			
		||||
@@ -21444,6 +21559,18 @@
 | 
			
		||||
        "$ref": "#/definitions/RepoCollaboratorPermission"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "RepoIssueConfig": {
 | 
			
		||||
      "description": "RepoIssueConfig",
 | 
			
		||||
      "schema": {
 | 
			
		||||
        "$ref": "#/definitions/IssueConfig"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "RepoIssueConfigValidation": {
 | 
			
		||||
      "description": "RepoIssueConfigValidation",
 | 
			
		||||
      "schema": {
 | 
			
		||||
        "$ref": "#/definitions/IssueConfigValidation"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "Repository": {
 | 
			
		||||
      "description": "Repository",
 | 
			
		||||
      "schema": {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user