{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cm-com/json-schema/cm-com-file-schema.json",
  "title": "File",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cm-com-document-api-openapi.yml#/components/schemas/File",
  "allOf": [
    {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/FileId"
        }
      },
      "required": [
        "id"
      ]
    },
    {
      "$ref": "#/$defs/FileBase"
    }
  ],
  "$defs": {
    "FileBase": {
      "title": "File",
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Original name of the file without extension",
          "maxLength": 255
        },
        "hash": {
          "type": "string",
          "description": "A sha256 hash of the document",
          "maxLength": 64,
          "readOnly": true
        },
        "uploadDateTime": {
          "type": "string",
          "format": "date-time",
          "description": "The time at which the file was uploaded",
          "readOnly": true
        },
        "size": {
          "type": "integer",
          "description": "The size of the file in bytes"
        },
        "contentType": {
          "type": "string",
          "description": "The content type identifying the type of file",
          "readOnly": true
        }
      },
      "required": [
        "name",
        "hash",
        "uploadDateTime",
        "contentType"
      ]
    },
    "FileId": {
      "$ref": "#/$defs/FileReference",
      "readOnly": true
    },
    "FileReference": {
      "type": "string",
      "format": "uuid",
      "description": "A unique reference number for this file."
    }
  }
}