{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-document-intelligence/json-schema/azure-document-intelligence-train-request-schema.json",
  "title": "TrainRequest",
  "description": "Request parameter to train a new custom model.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/azure-document-intelligence-custom-api-openapi.yml#/components/schemas/TrainRequest",
  "required": [
    "source"
  ],
  "type": "object",
  "properties": {
    "source": {
      "description": "Source path containing the training documents.",
      "maxLength": 2048,
      "minLength": 0,
      "type": "string"
    },
    "sourceFilter": {
      "$ref": "#/$defs/TrainSourceFilter",
      "description": "Filter to apply to the documents in the source path for training."
    },
    "useLabelFile": {
      "description": "Use label file for training a model.",
      "type": "boolean",
      "default": false
    },
    "modelName": {
      "$ref": "#/$defs/ModelName"
    }
  },
  "$defs": {
    "ModelName": {
      "description": "Optional user defined model name (max length: 1024).",
      "type": "string"
    },
    "TrainSourceFilter": {
      "description": "Filter to apply to the documents in the source path for training.",
      "type": "object",
      "properties": {
        "prefix": {
          "description": "A case-sensitive prefix string to filter documents in the source path for training. For example, when using a Azure storage blob Uri, use the prefix to restrict sub folders for training.",
          "maxLength": 1024,
          "minLength": 0,
          "type": "string"
        },
        "includeSubFolders": {
          "description": "A flag to indicate if sub folders within the set of prefix folders will also need to be included when searching for content to be preprocessed.",
          "type": "boolean",
          "default": false
        }
      }
    }
  }
}