{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/codecov/main/json-schema/codecov-pull-schema.json",
  "title": "Pull",
  "x-generated": "2026-10-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codecov-pulls-api-openapi.yml#/components/schemas/Pull",
  "type": "object",
  "properties": {
    "pullid": {
      "type": "integer",
      "title": "pull ID number"
    },
    "title": {
      "type": "string",
      "title": "title of the pull"
    },
    "base_totals": {
      "allOf": [
        {
          "$ref": "#/$defs/CommitTotals"
        }
      ],
      "title": "coverage totals of base commit"
    },
    "head_totals": {
      "allOf": [
        {
          "$ref": "#/$defs/CommitTotals"
        }
      ],
      "title": "coverage totals of head commit"
    },
    "updatestamp": {
      "type": "string",
      "format": "date-time",
      "title": "last updated timestamp"
    },
    "state": {
      "allOf": [
        {
          "$ref": "#/$defs/PullStateEnum"
        }
      ],
      "title": "state of the pull"
    },
    "ci_passed": {
      "type": "boolean",
      "title": "indicates whether the CI process passed for the head commit of this pull"
    },
    "author": {
      "allOf": [
        {
          "$ref": "#/$defs/Owner"
        }
      ],
      "title": "pull author"
    },
    "patch": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "number",
        "format": "double"
      },
      "readOnly": true
    }
  },
  "required": [
    "author",
    "base_totals",
    "ci_passed",
    "head_totals",
    "patch",
    "pullid",
    "state",
    "title",
    "updatestamp"
  ],
  "$defs": {
    "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"
      ]
    },
    "PullStateEnum": {
      "enum": [
        "open",
        "merged",
        "closed"
      ],
      "type": "string",
      "description": "* `open` - Open\n* `merged` - Merged\n* `closed` - Closed"
    },
    "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"
    }
  }
}