{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "format": "uri"
    },
    "canonical_url": {
      "type": "string",
      "format": "uri"
    },
    "host": {
      "type": "string",
      "minLength": 1
    },
    "title": {
      "type": "string",
      "minLength": 1
    },
    "description": {
      "type": "string",
      "maxLength": 500
    },
    "site_name": {
      "type": "string"
    },
    "author": {
      "type": "string"
    },
    "published_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "reading_minutes": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "image_url": {
      "type": "string",
      "format": "uri"
    },
    "favicon_url": {
      "type": "string",
      "format": "uri"
    },
    "favicon_key": {
      "type": "string"
    },
    "context": {
      "type": "string",
      "maxLength": 500
    },
    "origin": {
      "type": "string",
      "known": ["page", "shared_text", "caption", "transcript", "on_screen"]
    },
    "mention": {
      "type": "string",
      "maxLength": 200
    },
    "metadata": {
      "type": "string",
      "known": ["read", "unavailable"]
    },
    "resolved_from": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "method": {
          "type": "string",
          "known": ["domain_guess", "search"]
        },
        "identity": {
          "type": "string"
        },
        "topic": {
          "type": "string"
        }
      },
      "required": ["name", "method", "identity", "topic"]
    },
    "affiliate": {
      "type": "boolean"
    },
    "preview": {
      "type": "string",
      "known": ["image", "favicon", "none"]
    },
    "meta": {
      "type": "object",
      "properties": {
        "created_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        "deleted_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        "legacy_ref": {
          "type": "object",
          "properties": {
            "table": {
              "type": "string"
            },
            "key": {
              "type": ["string", "number"]
            },
            "row": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": ["table", "key", "row"]
        },
        "dataset": {
          "type": "string"
        }
      }
    }
  },
  "required": ["url", "canonical_url", "host", "title", "origin", "metadata"],
  "$id": "https://sendtopigeon.com/schemas/link@1.read.schema.json",
  "title": "Pigeon Open Data: link@1.read",
  "$comment": "Apache-2.0. Structural schema; use Zod/parseRecord for semantic invariants. This published schema URL is immutable.",
  "examples": [
    {
      "url": "https://example.invalid/item",
      "canonical_url": "https://example.invalid/item",
      "host": "demo",
      "title": "demo",
      "description": "demo",
      "reading_minutes": 1,
      "image_url": "https://example.invalid/item",
      "context": "demo",
      "origin": "page",
      "metadata": "read"
    }
  ]
}
