{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "$id": "https://raw.githubusercontent.com/api-evangelist/folio/main/json-schema/folio-file-definition-schema.json",
  "title": "fileDefinition",
  "description": "File definition",
  "x-generated": "2026-10-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/folio-mod-data-export-openapi.yml#/components/schemas/fileDefinition",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "UUID of this File Definition",
      "type": "string",
      "format": "uuid"
    },
    "fileName": {
      "description": "File name",
      "type": "string"
    },
    "jobExecutionId": {
      "description": "Job execution id",
      "type": "string",
      "format": "uuid"
    },
    "sourcePath": {
      "description": "Path to the file",
      "type": "string"
    },
    "status": {
      "description": "Status of file upload",
      "type": "string",
      "enum": [
        "NEW",
        "IN_PROGRESS",
        "COMPLETED",
        "ERROR"
      ]
    },
    "size": {
      "description": "Size of the file in Kbyte",
      "type": "integer"
    },
    "uploadFormat": {
      "description": "Format of upload file",
      "type": "string",
      "enum": [
        "csv",
        "cql"
      ],
      "default": "csv"
    },
    "metadata": {
      "description": "Meta information ",
      "type": "object",
      "$ref": "#/$defs/metadata"
    }
  },
  "required": [
    "fileName"
  ],
  "$defs": {
    "metadata": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "type": "object",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  }
}