{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-ai-search/json-schema/azure-ai-search-knowledge-source-file-schema.json",
  "title": "KnowledgeSourceFile",
  "description": "Metadata for a file uploaded to a File knowledge source.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/azure-ai-search-knowledgesources-sourcename-api-openapi.yml#/components/schemas/KnowledgeSourceFile",
  "type": "object",
  "properties": {
    "fileId": {
      "type": "string",
      "description": "The unique identifier for the file.",
      "readOnly": true
    },
    "fileName": {
      "type": "string",
      "description": "The original file name.",
      "readOnly": true
    },
    "fileSizeBytes": {
      "type": "integer",
      "format": "int64",
      "description": "The file size in bytes.",
      "readOnly": true
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the file was created.",
      "readOnly": true
    },
    "lastUpdatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp when the file was last updated.",
      "readOnly": true
    },
    "errorMessage": {
      "type": [
        "string",
        "null"
      ],
      "description": "The error message if file processing failed, null otherwise.",
      "readOnly": true
    },
    "prefix": {
      "type": "string",
      "description": "The prefix (directory-like path) derived from the full file name.",
      "readOnly": true
    },
    "metadata": {
      "type": "object",
      "description": "Custom key/value metadata stored with the file. Returned but not searchable or filterable.",
      "additionalProperties": {
        "type": "string"
      },
      "readOnly": true
    },
    "parsingMode": {
      "$ref": "#/$defs/BlobIndexerParsingMode",
      "description": "The parsing mode applied to the file (auto-detected from the file).",
      "readOnly": true
    },
    "extractionMode": {
      "$ref": "#/$defs/FileKnowledgeSourceExtractionMode",
      "description": "The extraction mode applied to the file.",
      "readOnly": true
    }
  },
  "$defs": {
    "BlobIndexerParsingMode": {
      "type": "string",
      "description": "Represents the parsing mode for indexing from an Azure blob data source.",
      "enum": [
        "default",
        "text",
        "delimitedText",
        "json",
        "jsonArray",
        "jsonLines",
        "markdown"
      ],
      "x-ms-enum": {
        "name": "BlobIndexerParsingMode",
        "modelAsString": true,
        "values": [
          {
            "name": "Default",
            "value": "default",
            "description": "Set to default for normal file processing."
          },
          {
            "name": "Text",
            "value": "text",
            "description": "Set to text to improve indexing performance on plain text files in blob storage."
          },
          {
            "name": "DelimitedText",
            "value": "delimitedText",
            "description": "Set to delimitedText when blobs are plain CSV files."
          },
          {
            "name": "Json",
            "value": "json",
            "description": "Set to json to extract structured content from JSON files."
          },
          {
            "name": "JsonArray",
            "value": "jsonArray",
            "description": "Set to jsonArray to extract individual elements of a JSON array as separate documents."
          },
          {
            "name": "JsonLines",
            "value": "jsonLines",
            "description": "Set to jsonLines to extract individual JSON entities, separated by a new line, as separate documents."
          },
          {
            "name": "Markdown",
            "value": "markdown",
            "description": "Set to markdown to extract content from markdown files."
          }
        ]
      }
    },
    "FileKnowledgeSourceExtractionMode": {
      "type": "string",
      "description": "The extraction effort applied to an individual file. 'minimal' (the default) uses built-in extraction; 'standard' uses Content Understanding.",
      "enum": [
        "minimal",
        "standard"
      ],
      "x-ms-enum": {
        "name": "FileKnowledgeSourceExtractionMode",
        "modelAsString": true,
        "values": [
          {
            "name": "Minimal",
            "value": "minimal",
            "description": "Built-in extraction was performed."
          },
          {
            "name": "Standard",
            "value": "standard",
            "description": "Content Understanding extraction was performed."
          }
        ]
      }
    }
  }
}