{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-repo/json-schema/microsoft-azure-repo-git-ref-schema.json",
  "title": "GitRef",
  "description": "A Git ref (branch or tag) including its name, object ID, and optional creator and status information.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-repo-refs-api-openapi.yml#/components/schemas/GitRef",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Full ref name (e.g., refs/heads/main, refs/tags/v1.0)"
    },
    "objectId": {
      "type": "string",
      "description": "SHA-1 hash the ref points to"
    },
    "peeledObjectId": {
      "type": "string",
      "description": "For annotated tags, the SHA-1 of the target object"
    },
    "creator": {
      "$ref": "#/$defs/IdentityRef"
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "REST API URL for this ref"
    },
    "statuses": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GitStatus"
      },
      "description": "Status checks for this ref"
    },
    "isLocked": {
      "type": "boolean",
      "description": "Whether the ref is locked"
    },
    "isLockedBy": {
      "$ref": "#/$defs/IdentityRef"
    }
  },
  "$defs": {
    "GitStatus": {
      "type": "object",
      "description": "Status metadata posted by a service or extension against a commit or pull request, such as build results or policy checks.",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32",
          "description": "Status identifier"
        },
        "state": {
          "type": "string",
          "enum": [
            "notSet",
            "pending",
            "succeeded",
            "failed",
            "error",
            "notApplicable"
          ],
          "description": "State of the status"
        },
        "description": {
          "type": "string",
          "description": "Status description"
        },
        "context": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "Name of the status context"
            },
            "genre": {
              "type": "string",
              "description": "Genre of the status"
            }
          }
        },
        "targetUrl": {
          "type": "string",
          "format": "uri",
          "description": "URL with status details"
        },
        "createdBy": {
          "$ref": "#/$defs/IdentityRef"
        },
        "creationDate": {
          "type": "string",
          "format": "date-time"
        },
        "updatedDate": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "IdentityRef": {
      "type": "object",
      "description": "Reference to an Azure DevOps identity (user or group)",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identity ID"
        },
        "displayName": {
          "type": "string",
          "description": "Display name of the identity"
        },
        "uniqueName": {
          "type": "string",
          "description": "Unique name (typically email)"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "REST API URL for this identity"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri",
          "description": "URL to the identity's avatar image"
        },
        "descriptor": {
          "type": "string",
          "description": "Graph descriptor for the identity"
        },
        "isContainer": {
          "type": "boolean",
          "description": "Whether this identity is a group"
        }
      }
    }
  }
}