{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fareeqy-com/json-schema/fareeqy-com-search-result-schema.json",
  "title": "SearchResult",
  "description": "A unified search hit. The shape depends on `type`; each carries the refs/ids the other endpoints take, and a `url`.\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fareeqy-com-account-api-openapi.yml#/components/schemas/SearchResult",
  "oneOf": [
    {
      "$ref": "#/$defs/SearchProject"
    },
    {
      "$ref": "#/$defs/SearchTaskList"
    },
    {
      "$ref": "#/$defs/SearchTask"
    },
    {
      "$ref": "#/$defs/SearchFolder"
    },
    {
      "$ref": "#/$defs/SearchFile"
    },
    {
      "$ref": "#/$defs/SearchDiscussion"
    }
  ],
  "$defs": {
    "SearchDiscussion": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "discussion"
        },
        "id": {
          "type": "string",
          "description": "The majlis topic ref."
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Absolute address of the page a person opens in فريقي."
        },
        "title": {
          "type": "string"
        },
        "project_slug": {
          "type": "string",
          "description": "The project ref. Named _slug for compatibility."
        },
        "discussion_slug": {
          "type": "string",
          "description": "The majlis topic ref. Named _slug for compatibility."
        }
      }
    },
    "SearchFile": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "file"
        },
        "id": {
          "type": "string",
          "description": "The file ref."
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Absolute address of the page a person opens in فريقي."
        },
        "name": {
          "type": "string"
        },
        "project_slug": {
          "type": "string",
          "description": "The project ref. Named _slug for compatibility."
        },
        "file_id": {
          "type": "integer"
        },
        "folder_id": {
          "type": [
            "integer",
            "null"
          ]
        }
      }
    },
    "SearchFolder": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "folder"
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The project's files page scoped to this folder."
        },
        "name": {
          "type": "string"
        },
        "project_slug": {
          "type": "string",
          "description": "The project ref. Named _slug for compatibility."
        },
        "folder_id": {
          "type": "integer"
        }
      }
    },
    "SearchProject": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "project"
        },
        "id": {
          "type": "string",
          "description": "The project ref."
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Absolute address of the page a person opens in فريقي."
        },
        "title": {
          "type": "string"
        },
        "project_slug": {
          "type": "string",
          "description": "The project ref. Named _slug for compatibility."
        },
        "archived": {
          "type": "boolean"
        }
      }
    },
    "SearchTask": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "task"
        },
        "id": {
          "type": "string",
          "description": "The task ref."
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Absolute address of the page a person opens in فريقي."
        },
        "title": {
          "type": "string"
        },
        "project_slug": {
          "type": "string",
          "description": "The project ref. Named _slug for compatibility."
        },
        "task_list_slug": {
          "type": "string",
          "description": "The task-list ref. Named _slug for compatibility."
        },
        "task_slug": {
          "type": "string",
          "description": "The task ref. Named _slug for compatibility."
        },
        "completed": {
          "type": "boolean"
        }
      }
    },
    "SearchTaskList": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "task_list"
        },
        "id": {
          "type": "string",
          "description": "The task-list ref."
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Absolute address of the page a person opens in فريقي."
        },
        "title": {
          "type": "string"
        },
        "project_slug": {
          "type": "string",
          "description": "The project ref. Named _slug for compatibility."
        },
        "task_list_slug": {
          "type": "string",
          "description": "The task-list ref. Named _slug for compatibility."
        },
        "completed": {
          "type": "boolean"
        }
      }
    }
  }
}