{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/simple-ai/json-schema/simple-ai-custom-data-facets-response-schema.json",
  "title": "Custom Data Facets Response",
  "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/CustomDataFacetsResponse",
  "type": "object",
  "required": [
    "tableName",
    "tableLabel",
    "totalRecords",
    "facets"
  ],
  "properties": {
    "tableName": {
      "type": "string",
      "title": "Table Name"
    },
    "tableLabel": {
      "type": "string",
      "title": "Table Label"
    },
    "totalRecords": {
      "type": "integer",
      "title": "Total Records"
    },
    "facets": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CustomDataColumnFacet"
      },
      "title": "Facets"
    }
  },
  "$defs": {
    "CustomDataColumnFacet": {
      "type": "object",
      "required": [
        "columnName",
        "columnDisplayName",
        "columnType",
        "values"
      ],
      "properties": {
        "columnName": {
          "type": "string",
          "title": "Column Name"
        },
        "columnDisplayName": {
          "type": "string",
          "title": "Column Display Name"
        },
        "columnType": {
          "$ref": "#/$defs/CustomDataColumnType"
        },
        "values": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CustomDataFacetValue"
          },
          "title": "Values"
        }
      },
      "title": "Custom Data Column Facet"
    },
    "CustomDataColumnType": {
      "type": "string",
      "enum": [
        "STRING",
        "NUMERIC",
        "BOOLEAN",
        "JSONB",
        "TIMESTAMP",
        "REFERENCE",
        "STRING_ARRAY",
        "NUMERIC_ARRAY",
        "BOOLEAN_ARRAY",
        "TIMESTAMP_ARRAY",
        "OBJECT"
      ],
      "title": "Custom Data Column Type"
    },
    "CustomDataFacetValue": {
      "type": "object",
      "required": [
        "value",
        "count"
      ],
      "properties": {
        "value": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            }
          ],
          "title": "Value"
        },
        "count": {
          "type": "integer",
          "title": "Count"
        }
      },
      "title": "Custom Data Facet Value"
    }
  }
}