{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/indices-io/json-schema/indices-io-file-schema.json",
  "title": "File",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/indices-io-openapi.json#/components/schemas/File",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the object."
    },
    "source": {
      "$ref": "#/$defs/FileSource",
      "description": "How the file came to exist: uploaded by the user or produced by a run."
    },
    "run_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "ID of the run that produced this file. Null for uploaded files."
    },
    "name": {
      "type": "string",
      "description": "User-facing filename."
    },
    "size_bytes": {
      "type": "integer",
      "description": "Size of the file in bytes."
    },
    "content_type": {
      "type": "string",
      "description": "MIME type of the file."
    },
    "crc32c": {
      "type": "string",
      "description": "Base64-encoded CRC32C checksum of the file content."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp when the file was created."
    }
  },
  "type": "object",
  "required": [
    "id",
    "source",
    "run_id",
    "name",
    "size_bytes",
    "content_type",
    "crc32c",
    "created_at"
  ],
  "$defs": {
    "FileSource": {
      "type": "string",
      "enum": [
        "UPLOAD",
        "RUN_OUTPUT"
      ],
      "title": "FileSource"
    }
  }
}