{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-devops/json-schema/microsoft-azure-devops-build-definition-create-request-schema.json",
  "title": "BuildDefinitionCreateRequest",
  "description": "Request to create a new build definition",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-devops-build-definitions-api-openapi.yml#/components/schemas/BuildDefinitionCreateRequest",
  "type": "object",
  "required": [
    "name",
    "repository",
    "process",
    "queue"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "Display name of the build definition"
    },
    "path": {
      "type": "string",
      "description": "Folder path for the definition",
      "default": "\\"
    },
    "type": {
      "type": "string",
      "enum": [
        "xaml",
        "build"
      ],
      "default": "build"
    },
    "repository": {
      "$ref": "#/$defs/BuildRepository"
    },
    "process": {
      "type": "object",
      "description": "Build process configuration",
      "properties": {
        "yamlFilename": {
          "type": "string"
        },
        "type": {
          "type": "integer"
        }
      }
    },
    "queue": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        }
      }
    },
    "variables": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string"
          },
          "isSecret": {
            "type": "boolean"
          }
        }
      }
    },
    "triggers": {
      "type": "array",
      "items": {
        "type": "object"
      }
    }
  },
  "$defs": {
    "BuildRepository": {
      "type": "object",
      "description": "Repository configuration for a build",
      "properties": {
        "id": {
          "type": "string",
          "description": "Repository ID (GUID for Git, name for TFVC)"
        },
        "name": {
          "type": "string",
          "description": "Repository name"
        },
        "type": {
          "type": "string",
          "description": "Repository type",
          "enum": [
            "TfsGit",
            "TfsVersionControl",
            "GitHub",
            "Bitbucket",
            "GitHubEnterprise"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "URL of the repository"
        },
        "defaultBranch": {
          "type": "string",
          "description": "Default branch for this repository"
        },
        "checkoutSubmodules": {
          "type": "boolean",
          "description": "Whether to checkout Git submodules"
        },
        "clean": {
          "type": "string",
          "description": "Whether to clean the working directory before each build",
          "enum": [
            "true",
            "false",
            null
          ]
        },
        "properties": {
          "type": "object",
          "additionalProperties": true
        }
      }
    }
  }
}