{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/simple-ai/json-schema/simple-ai-custom-data-table-schema.json",
  "title": "Custom Data Table",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/simple-ai-custom-data-api-openapi.yml#/components/schemas/CustomDataTable",
  "type": "object",
  "required": [
    "id",
    "name",
    "label",
    "searchIndexingEnabled",
    "columns",
    "recordCount",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "integer",
      "title": "ID"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "label": {
      "type": "string",
      "title": "Label"
    },
    "searchIndexingEnabled": {
      "type": "boolean",
      "title": "Search Indexing Enabled"
    },
    "columns": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CustomDataColumn"
      },
      "title": "Columns"
    },
    "recordCount": {
      "type": "integer",
      "title": "Record Count"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    }
  },
  "$defs": {
    "CustomDataColumn": {
      "type": "object",
      "required": [
        "id",
        "name",
        "type",
        "displayName",
        "referenceTable",
        "jsonSchema",
        "position"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "title": "ID"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "type": {
          "$ref": "#/$defs/CustomDataColumnType"
        },
        "displayName": {
          "type": "string",
          "title": "Display Name"
        },
        "referenceTable": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reference Table"
        },
        "jsonSchema": {
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": true
            },
            {
              "type": "null"
            }
          ],
          "title": "JSON Schema"
        },
        "position": {
          "type": "integer",
          "title": "Position"
        }
      },
      "title": "Custom Data Column"
    },
    "CustomDataColumnType": {
      "type": "string",
      "enum": [
        "STRING",
        "NUMERIC",
        "BOOLEAN",
        "JSONB",
        "TIMESTAMP",
        "REFERENCE",
        "STRING_ARRAY",
        "NUMERIC_ARRAY",
        "BOOLEAN_ARRAY",
        "TIMESTAMP_ARRAY",
        "OBJECT"
      ],
      "title": "Custom Data Column Type"
    }
  }
}