{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/github/json-schema/github-code-quality-finding-schema.json",
  "title": "code-quality-finding",
  "description": "Code quality finding",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/github-code-quality-api-openapi.yml#/components/schemas/code-quality-finding",
  "type": "object",
  "properties": {
    "number": {
      "description": "The finding number.",
      "type": "integer"
    },
    "state": {
      "description": "State of the code quality finding.",
      "type": "string",
      "enum": [
        "open",
        "dismissed"
      ]
    },
    "url": {
      "description": "The REST API URL of the code quality finding resource.",
      "type": "string",
      "format": "uri"
    },
    "rule": {
      "$ref": "#/$defs/code-quality-finding-rule"
    },
    "location": {
      "$ref": "#/$defs/code-quality-finding-location"
    },
    "message": {
      "$ref": "#/$defs/code-quality-finding-message"
    },
    "created_at": {
      "description": "The time the code quality finding was created.",
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "number",
    "state",
    "url",
    "rule",
    "location",
    "message"
  ],
  "$defs": {
    "code-quality-finding-location": {
      "description": "Code quality file location",
      "type": "object",
      "properties": {
        "path": {
          "description": "The file path where the finding was detected.",
          "type": "string"
        },
        "start_line": {
          "description": "The line number where the finding starts.",
          "type": "integer"
        },
        "start_column": {
          "description": "The column number where the finding starts.",
          "type": "integer"
        },
        "end_line": {
          "description": "The line number where the finding ends.",
          "type": "integer"
        },
        "end_column": {
          "description": "The column number where the finding ends.",
          "type": "integer"
        }
      },
      "required": [
        "path"
      ]
    },
    "code-quality-finding-message": {
      "description": "Code quality finding message",
      "type": "object",
      "properties": {
        "text": {
          "description": "The message text of the code quality finding.",
          "type": "string"
        },
        "markdown": {
          "description": "The message text of the code quality finding in markdown format.",
          "type": "string"
        }
      },
      "required": [
        "text",
        "markdown"
      ]
    },
    "code-quality-finding-rule": {
      "description": "Code quality rule",
      "type": "object",
      "properties": {
        "id": {
          "description": "A unique identifier for the rule used to detect the finding.",
          "type": "string"
        },
        "title": {
          "description": "The name of the rule used to detect the finding.",
          "type": "string"
        },
        "description": {
          "description": "A short description of the rule used to detect the finding.",
          "type": "string"
        },
        "help": {
          "description": "A detailed description of the rule used to detect the finding.",
          "type": "string"
        },
        "severity": {
          "description": "The severity of the rule used to detect the finding.",
          "type": "string",
          "enum": [
            "error",
            "warning",
            "note",
            "none"
          ]
        },
        "category": {
          "description": "The category of the rule used to detect the finding.",
          "type": "string",
          "enum": [
            "none",
            "maintainability",
            "reliability"
          ]
        }
      },
      "required": [
        "id",
        "title",
        "description",
        "severity",
        "category"
      ]
    }
  }
}