{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-devops/json-schema/microsoft-azure-devops-git-item-schema.json",
  "title": "GitItem",
  "description": "A file or folder in a Git repository",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-devops-repositories-api-openapi.yml#/components/schemas/GitItem",
  "type": "object",
  "properties": {
    "objectId": {
      "type": "string",
      "description": "Git blob or tree SHA"
    },
    "gitObjectType": {
      "type": "string",
      "description": "Git object type",
      "enum": [
        "bad",
        "commit",
        "tree",
        "blob",
        "tag",
        "ext2",
        "offsetDelta",
        "refDelta"
      ]
    },
    "commitId": {
      "type": "string",
      "description": "SHA of the commit this item belongs to"
    },
    "path": {
      "type": "string",
      "description": "Path to the item within the repository"
    },
    "isFolder": {
      "type": "boolean",
      "description": "Whether this item is a folder (tree)"
    },
    "isSymLink": {
      "type": "boolean",
      "description": "Whether this item is a symbolic link"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "content": {
      "type": "string",
      "description": "File content (if requested and item is a file)"
    },
    "contentMetadata": {
      "type": "object",
      "description": "Metadata about the file content",
      "properties": {
        "encoding": {
          "type": "integer",
          "description": "Text encoding (code page)"
        },
        "extension": {
          "type": "string"
        },
        "fileName": {
          "type": "string"
        },
        "isBinary": {
          "type": "boolean"
        },
        "isImage": {
          "type": "boolean"
        }
      }
    },
    "latestProcessedChange": {
      "$ref": "#/$defs/GitCommitRef"
    }
  },
  "$defs": {
    "GitCommitRef": {
      "type": "object",
      "description": "A reference to a Git commit",
      "properties": {
        "commitId": {
          "type": "string",
          "description": "Full SHA hash of the commit"
        },
        "comment": {
          "type": "string",
          "description": "Commit message"
        },
        "commentTruncated": {
          "type": "boolean",
          "description": "Whether the comment has been truncated"
        },
        "author": {
          "$ref": "#/$defs/GitUserDate"
        },
        "committer": {
          "$ref": "#/$defs/GitUserDate"
        },
        "parents": {
          "type": "array",
          "description": "Parent commit SHAs",
          "items": {
            "type": "string"
          }
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "remoteUrl": {
          "type": "string",
          "format": "uri"
        },
        "changeCounts": {
          "type": "object",
          "description": "Number of files changed (Add, Edit, Delete)",
          "properties": {
            "Add": {
              "type": "integer"
            },
            "Edit": {
              "type": "integer"
            },
            "Delete": {
              "type": "integer"
            }
          }
        }
      }
    },
    "GitUserDate": {
      "type": "object",
      "description": "Git user and date information",
      "properties": {
        "name": {
          "type": "string",
          "description": "User display name"
        },
        "email": {
          "type": "string",
          "format": "email",
          "description": "User email address"
        },
        "date": {
          "type": "string",
          "format": "date-time",
          "description": "Date and time of the action"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  }
}