{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-devops/json-schema/microsoft-azure-devops-git-push-create-request-schema.json",
  "title": "GitPushCreateRequest",
  "description": "Request to create a push with new commits",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-devops-pushes-api-openapi.yml#/components/schemas/GitPushCreateRequest",
  "type": "object",
  "required": [
    "refUpdates",
    "commits"
  ],
  "properties": {
    "refUpdates": {
      "type": "array",
      "description": "Branch updates to apply in this push",
      "items": {
        "$ref": "#/$defs/GitRefUpdate"
      }
    },
    "commits": {
      "type": "array",
      "description": "Commits to push",
      "items": {
        "type": "object",
        "required": [
          "comment",
          "changes"
        ],
        "properties": {
          "comment": {
            "type": "string",
            "description": "Commit message"
          },
          "changes": {
            "type": "array",
            "description": "File changes in this commit",
            "items": {
              "type": "object",
              "properties": {
                "changeType": {
                  "type": "string",
                  "enum": [
                    "add",
                    "edit",
                    "delete",
                    "rename",
                    "sourceRename",
                    "targetRename"
                  ]
                },
                "item": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "string"
                    }
                  }
                },
                "newContent": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "string"
                    },
                    "contentType": {
                      "type": "string",
                      "enum": [
                        "rawText",
                        "base64Encoded"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "$defs": {
    "GitRefUpdate": {
      "type": "object",
      "description": "A ref update in a push",
      "properties": {
        "name": {
          "type": "string",
          "description": "The ref name (e.g., refs/heads/main)"
        },
        "oldObjectId": {
          "type": "string",
          "description": "Previous SHA the ref pointed to (zeros for new ref)"
        },
        "newObjectId": {
          "type": "string",
          "description": "New SHA the ref now points to (zeros to delete)"
        },
        "repositoryId": {
          "type": "string",
          "format": "uuid"
        }
      }
    }
  }
}