{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pointcast.xyz/linktree/links.schema.json",
  "title": "PointCast Link Directory",
  "type": "object",
  "required": ["title", "canonical_url", "latest_focus", "profile", "sections"],
  "properties": {
    "title": { "type": "string" },
    "canonical_url": { "type": "string", "format": "uri" },
    "latest_focus": { "$ref": "#/$defs/link_with_description" },
    "profile": {
      "type": "object",
      "required": ["name", "organization", "description"],
      "properties": {
        "name": { "type": "string" },
        "organization": { "type": "string" },
        "description": { "type": "string" }
      }
    },
    "sections": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["label", "links"],
        "properties": {
          "label": { "type": "string" },
          "links": {
            "type": "array",
            "items": { "$ref": "#/$defs/link" }
          }
        }
      }
    },
    "capabilities": {
      "type": "array",
      "items": { "type": "string" }
    },
    "participation": { "$ref": "#/$defs/link" }
  },
  "$defs": {
    "link": {
      "type": "object",
      "required": ["label", "url"],
      "properties": {
        "label": { "type": "string" },
        "url": { "type": "string", "format": "uri" }
      }
    },
    "link_with_description": {
      "allOf": [
        { "$ref": "#/$defs/link" },
        {
          "type": "object",
          "required": ["description"],
          "properties": {
            "description": { "type": "string" }
          }
        }
      ]
    }
  }
}
