{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/View",
  "title": "View",
  "type": "object",
  "description": "A view object defining how tasks are displayed and filtered.",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique identifier of the view."
    },
    "name": {
      "type": "string",
      "description": "The name of the view."
    },
    "type": {
      "type": "string",
      "enum": [
        "list",
        "board",
        "calendar",
        "gantt",
        "table",
        "timeline",
        "workload",
        "activity",
        "map",
        "conversation"
      ],
      "description": "The type of view."
    },
    "parent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The parent object ID."
        },
        "type": {
          "type": "integer",
          "description": "The parent type code."
        }
      },
      "description": "The parent object (team, space, folder, or list)."
    },
    "grouping": {
      "type": "object",
      "properties": {
        "field": {
          "type": "string",
          "description": "The field to group tasks by."
        },
        "dir": {
          "type": "integer",
          "description": "The grouping direction. 1 for ascending, -1 for descending."
        },
        "collapsed": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "IDs of collapsed groups."
        },
        "ignore": {
          "type": "boolean",
          "description": "Whether to ignore grouping."
        }
      },
      "description": "The grouping configuration."
    },
    "divide": {
      "type": "object",
      "properties": {
        "field": {
          "type": "string",
          "description": "The field to divide (swimlane) by."
        },
        "dir": {
          "type": "integer",
          "description": "The divide direction."
        },
        "collapsed": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "IDs of collapsed divisions."
        }
      },
      "description": "The divide (swimlane) configuration."
    },
    "sorting": {
      "type": "object",
      "properties": {
        "fields": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "field": {
                "type": "string",
                "description": "The field to sort by."
              },
              "dir": {
                "type": "integer",
                "description": "Sort direction. 1 for ascending, -1 for descending."
              }
            }
          },
          "description": "Array of sort field configurations."
        }
      },
      "description": "The sorting configuration."
    },
    "filters": {
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "enum": [
            "AND",
            "OR"
          ],
          "description": "The logical operator for combining filters."
        },
        "fields": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Array of filter conditions."
        },
        "search": {
          "type": "string",
          "description": "Text search filter."
        },
        "show_closed": {
          "type": "boolean",
          "description": "Whether to show closed tasks."
        }
      },
      "description": "The filter configuration."
    },
    "columns": {
      "type": "object",
      "properties": {
        "fields": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "field": {
                "type": "string",
                "description": "The column field name."
              },
              "hidden": {
                "type": "boolean",
                "description": "Whether the column is hidden."
              },
              "width": {
                "type": "integer",
                "description": "The column width in pixels."
              }
            }
          },
          "description": "Array of column configurations."
        }
      },
      "description": "The column configuration for table and list views."
    },
    "team_sidebar": {
      "type": "object",
      "description": "Team sidebar configuration."
    },
    "settings": {
      "type": "object",
      "properties": {
        "show_task_locations": {
          "type": "boolean",
          "description": "Whether to show task locations."
        },
        "show_subtasks": {
          "type": "integer",
          "description": "Subtask display mode."
        },
        "show_subtask_parent_names": {
          "type": "boolean",
          "description": "Whether to show parent task names."
        },
        "show_closed_subtasks": {
          "type": "boolean",
          "description": "Whether to show closed subtasks."
        },
        "show_assignees": {
          "type": "boolean",
          "description": "Whether to show assignees."
        },
        "show_images": {
          "type": "boolean",
          "description": "Whether to show images."
        },
        "collapse_empty_columns": {
          "type": "object",
          "nullable": true,
          "description": "Configuration for collapsing empty columns."
        },
        "me_comments": {
          "type": "boolean",
          "description": "Whether to filter to only my comments."
        },
        "me_subtasks": {
          "type": "boolean",
          "description": "Whether to filter to only my subtasks."
        },
        "me_checklists": {
          "type": "boolean",
          "description": "Whether to filter to only my checklists."
        }
      },
      "description": "View display settings."
    },
    "date_created": {
      "type": "string",
      "description": "Unix timestamp when the view was created."
    },
    "creator": {
      "type": "integer",
      "description": "The user ID of the view creator."
    },
    "visibility": {
      "type": "string",
      "description": "The visibility setting of the view."
    },
    "protected": {
      "type": "boolean",
      "description": "Whether the view is protected from editing."
    },
    "orderindex": {
      "type": "number",
      "description": "The order index of the view."
    }
  }
}