{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/codecov/main/json-schema/codecov-impacted-files-comparison-schema.json",
  "title": "ImpactedFilesComparison",
  "x-generated": "2026-10-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codecov-comparison-api-openapi.yml#/components/schemas/ImpactedFilesComparison",
  "type": "object",
  "properties": {
    "base_commit": {
      "type": "string"
    },
    "head_commit": {
      "type": "string"
    },
    "totals": {
      "$ref": "#/$defs/TotalsComparison"
    },
    "commit_uploads": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Commit"
      }
    },
    "diff": {
      "type": "object",
      "additionalProperties": {},
      "readOnly": true
    },
    "files": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": {}
      },
      "readOnly": true
    },
    "untracked": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "readOnly": true
    },
    "state": {
      "type": "string",
      "readOnly": true
    }
  },
  "required": [
    "base_commit",
    "commit_uploads",
    "diff",
    "files",
    "head_commit",
    "state",
    "totals",
    "untracked"
  ],
  "$defs": {
    "Commit": {
      "type": "object",
      "properties": {
        "commitid": {
          "type": "string",
          "title": "commit SHA"
        },
        "message": {
          "type": "string",
          "title": "commit message"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "title": "timestamp when commit was made"
        },
        "ci_passed": {
          "type": "boolean",
          "title": "indicates whether the CI process passed for this commit"
        },
        "author": {
          "allOf": [
            {
              "$ref": "#/$defs/Owner"
            }
          ],
          "title": "author of the commit"
        },
        "branch": {
          "type": "string",
          "title": "branch name on which this commit currently lives"
        },
        "totals": {
          "allOf": [
            {
              "$ref": "#/$defs/CommitTotals"
            }
          ],
          "title": "coverage totals"
        },
        "state": {
          "allOf": [
            {
              "$ref": "#/$defs/StateB73Enum"
            }
          ],
          "title": "Codecov processing state for this commit"
        },
        "parent": {
          "type": "string",
          "title": "commit SHA of first ancestor commit with coverage"
        }
      },
      "required": [
        "author",
        "branch",
        "ci_passed",
        "commitid",
        "message",
        "parent",
        "state",
        "timestamp",
        "totals"
      ]
    },
    "CommitTotals": {
      "type": "object",
      "properties": {
        "files": {
          "type": "integer"
        },
        "lines": {
          "type": "integer"
        },
        "hits": {
          "type": "integer"
        },
        "misses": {
          "type": "integer"
        },
        "partials": {
          "type": "integer"
        },
        "coverage": {
          "type": "number",
          "format": "double",
          "readOnly": true
        },
        "branches": {
          "type": "integer"
        },
        "methods": {
          "type": "integer"
        },
        "sessions": {
          "type": "integer"
        },
        "complexity": {
          "type": "number",
          "format": "double"
        },
        "complexity_total": {
          "type": "number",
          "format": "double"
        },
        "complexity_ratio": {
          "type": "number",
          "format": "double",
          "readOnly": true
        },
        "diff": {
          "type": "integer",
          "readOnly": true,
          "title": "Deprecated: this will always return 0.  Please use comparison endpoint for diff totals instead."
        }
      },
      "required": [
        "branches",
        "complexity",
        "complexity_ratio",
        "complexity_total",
        "coverage",
        "diff",
        "files",
        "hits",
        "lines",
        "methods",
        "misses",
        "partials",
        "sessions"
      ]
    },
    "Owner": {
      "type": "object",
      "properties": {
        "service": {
          "allOf": [
            {
              "$ref": "#/$defs/ServiceEnum"
            }
          ],
          "readOnly": true
        },
        "username": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true
        }
      },
      "required": [
        "name",
        "service",
        "username"
      ]
    },
    "ReportTotals": {
      "type": "object",
      "properties": {
        "files": {
          "type": "integer"
        },
        "lines": {
          "type": "integer"
        },
        "hits": {
          "type": "integer"
        },
        "misses": {
          "type": "integer"
        },
        "partials": {
          "type": "integer"
        },
        "coverage": {
          "type": "number",
          "format": "double",
          "readOnly": true
        },
        "branches": {
          "type": "integer"
        },
        "methods": {
          "type": "integer"
        },
        "messages": {
          "type": "integer"
        },
        "sessions": {
          "type": "integer"
        },
        "complexity": {
          "type": "number",
          "format": "double"
        },
        "complexity_total": {
          "type": "number",
          "format": "double"
        },
        "complexity_ratio": {
          "type": "number",
          "format": "double",
          "readOnly": true
        },
        "diff": {}
      },
      "required": [
        "branches",
        "complexity",
        "complexity_ratio",
        "complexity_total",
        "coverage",
        "diff",
        "files",
        "hits",
        "lines",
        "messages",
        "methods",
        "misses",
        "partials",
        "sessions"
      ]
    },
    "ServiceEnum": {
      "enum": [
        "github",
        "gitlab",
        "bitbucket",
        "github_enterprise",
        "gitlab_enterprise",
        "bitbucket_server"
      ],
      "type": "string",
      "description": "* `github` - Github\n* `gitlab` - Gitlab\n* `bitbucket` - Bitbucket\n* `github_enterprise` - Github Enterprise\n* `gitlab_enterprise` - Gitlab Enterprise\n* `bitbucket_server` - Bitbucket Server"
    },
    "StateB73Enum": {
      "enum": [
        "complete",
        "pending",
        "error",
        "skipped"
      ],
      "type": "string",
      "description": "* `complete` - Complete\n* `pending` - Pending\n* `error` - Error\n* `skipped` - Skipped"
    },
    "TotalsComparison": {
      "type": "object",
      "properties": {
        "base": {
          "$ref": "#/$defs/ReportTotals"
        },
        "head": {
          "$ref": "#/$defs/ReportTotals"
        },
        "patch": {
          "$ref": "#/$defs/ReportTotals"
        }
      },
      "required": [
        "base",
        "head",
        "patch"
      ]
    }
  }
}