{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/compelling-ai/json-schema/compelling-ai-view-schema.json",
  "title": "View",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/compelling-ai-openapi.yml#/components/schemas/View",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "list_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "filters": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Filter"
      }
    },
    "columns": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "sorting": {
      "$ref": "#/$defs/Sorting"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "Filter": {
      "type": "object",
      "required": [
        "field",
        "operator",
        "value"
      ],
      "properties": {
        "field": {
          "type": "string"
        },
        "operator": {
          "type": "string",
          "enum": [
            "eq",
            "neq",
            "contains",
            "gt",
            "lt",
            "in",
            "not_in"
          ]
        },
        "value": {}
      }
    },
    "Sorting": {
      "type": "object",
      "properties": {
        "field": {
          "type": "string"
        },
        "direction": {
          "type": "string",
          "enum": [
            "asc",
            "desc"
          ]
        }
      }
    }
  }
}