{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mdflow-cz/json-schema/mdflow-cz-folder-schema.json",
  "title": "Folder",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mdflow-cz-openapi.json#/components/schemas/Folder",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "name",
    "description",
    "parent_id",
    "workspace_id",
    "created_at",
    "updated_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "parent_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "workspace_id": {
      "type": "string",
      "format": "uuid",
      "description": "The workspace this folder belongs to."
    },
    "path": {
      "type": "array",
      "description": "Full path from the workspace root down to this folder, workspace first. Returned by the list and get endpoints; omitted from create and update responses.",
      "items": {
        "$ref": "#/$defs/PathSegment"
      }
    },
    "path_string": {
      "type": "string",
      "description": "Path segment names joined by \" / \". Returned by the list and get endpoints; omitted from create and update responses."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "PathSegment": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "name",
        "type"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "workspace",
            "folder",
            "document"
          ]
        }
      }
    }
  }
}