{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coralogix/json-schema/coralogix-comment-attachment-schema.json",
  "title": "Comment attachment",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coralogix-case-events-service-api-openapi.yml#/components/schemas/CommentAttachment",
  "type": "object",
  "oneOf": [
    {
      "required": [
        "log"
      ],
      "type": "object"
    },
    {
      "required": [
        "customWidget"
      ],
      "type": "object"
    },
    {
      "required": [
        "file"
      ],
      "type": "object"
    }
  ],
  "properties": {
    "customWidget": {
      "allOf": [
        {
          "$ref": "#/$defs/CustomDashboardWidgetAttachment"
        }
      ],
      "description": "Custom dashboard widget attachment with screenshot"
    },
    "file": {
      "allOf": [
        {
          "$ref": "#/$defs/FileAttachment"
        }
      ],
      "description": "Generic file attachment"
    },
    "log": {
      "allOf": [
        {
          "$ref": "#/$defs/LogAttachment"
        }
      ],
      "description": "Log entry attachment with content and metadata"
    }
  },
  "$defs": {
    "CustomDashboardWidgetAttachment": {
      "title": "Custom dashboard widget attachment",
      "required": [
        "customDashboardId",
        "widgetId",
        "widgetScreenshot"
      ],
      "type": "object",
      "properties": {
        "customDashboardId": {
          "maxLength": 4096,
          "minLength": 1,
          "pattern": "^[\\s\\S]*\\S[\\s\\S]*$",
          "type": "string",
          "description": "Unique identifier of the custom dashboard. Leading and trailing whitespace is trimmed before the length limits are applied."
        },
        "queryLinkSuffix": {
          "maxLength": 4096,
          "minLength": 0,
          "pattern": "^[\\s\\S]*$",
          "type": "string",
          "description": "URL suffix for accessing the widget (not including the Coralogix domain part)"
        },
        "widgetId": {
          "maxLength": 4096,
          "minLength": 1,
          "pattern": "^[\\s\\S]*\\S[\\s\\S]*$",
          "type": "string",
          "description": "Unique identifier of the widget within the dashboard. Leading and trailing whitespace is trimmed before the length limits are applied."
        },
        "widgetScreenshot": {
          "allOf": [
            {
              "$ref": "#/$defs/FileAttachment"
            }
          ],
          "description": "Screenshot of the widget at the time of attachment"
        }
      },
      "description": "Attachment containing custom dashboard widget data and screenshot"
    },
    "FileAttachment": {
      "title": "File attachment",
      "required": [
        "fileName",
        "fileId",
        "isDeleted"
      ],
      "type": "object",
      "properties": {
        "fileId": {
          "maxLength": 36,
          "minLength": 36,
          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
          "type": "string",
          "description": "Unique identifier of the file (same id as used in blobset flow)"
        },
        "fileName": {
          "maxLength": 4096,
          "minLength": 1,
          "pattern": "^[\\s\\S]*\\S[\\s\\S]*$",
          "type": "string",
          "description": "Original name of the attached file. Leading and trailing whitespace is trimmed before the length limits are applied."
        },
        "isDeleted": {
          "type": "boolean",
          "description": "Flag indicating whether the file has been marked as deleted"
        }
      },
      "description": "Attachment representing a file with metadata"
    },
    "LogAttachment": {
      "title": "Log attachment",
      "required": [
        "logId",
        "logTimestamp",
        "logContent"
      ],
      "type": "object",
      "properties": {
        "logContent": {
          "maxLength": 10000,
          "minLength": 1,
          "pattern": "^[\\s\\S]*\\S[\\s\\S]*$",
          "type": "string",
          "description": "Raw content of the log entry. Leading and trailing whitespace is trimmed before the length limits are applied."
        },
        "logId": {
          "maxLength": 36,
          "minLength": 36,
          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
          "type": "string",
          "description": "Unique identifier of the log entry"
        },
        "logTimestamp": {
          "description": "Timestamp when the log entry was created",
          "format": "date-time",
          "minLength": 0,
          "type": "string",
          "x-coralogix-presence": true
        },
        "queryLinkSuffix": {
          "maxLength": 4096,
          "minLength": 0,
          "pattern": "^[\\s\\S]*$",
          "type": "string",
          "description": "URL suffix for querying related logs (not including the Coralogix domain part)"
        }
      },
      "description": "Attachment containing log data and related information"
    }
  }
}