{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://diazoma.app/spec/v1/item.schema.json",
  "title": "Diazoma item v1",
  "description": "One card on the wall. Four core fields are required; everything else is optional and unknown fields are ignored.",
  "type": "object",
  "required": ["id", "link", "image", "aspect"],
  "properties": {
    "id": { "type": "string", "minLength": 1, "description": "Stable id, unique in the feed." },
    "link": { "type": "string", "minLength": 1, "description": "Page of the item on the site. Absolute, or relative to the feed URL." },
    "image": { "type": "string", "minLength": 1, "description": "Thumbnail URL (about 512 px wide)." },
    "aspect": { "type": "number", "exclusiveMinimum": 0, "description": "Width divided by height of the image." },
    "title": { "type": "string" },
    "subtitle": { "type": "string" },
    "image_focus": { "type": "string", "description": "Larger image (about 1024 px) for the focused card." },
    "image_full": { "type": "string", "description": "Full-size image (about 2560 px) for the viewer." },
    "video": { "type": "string", "description": "Video URL (mp4 or HLS)." },
    "projection": { "enum": ["flat", "equirect180", "equirect360"], "description": "Video projection; absent means flat." },
    "stereo": { "enum": ["mono", "sbs", "tb"], "description": "Stereo layout of the video; absent means mono." },
    "badges": { "type": "array", "items": { "type": "string" }, "description": "Short labels drawn on the card." },
    "blurhash": { "type": "string", "description": "Placeholder while the texture loads." },
    "meta": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Free key/value pairs shown in the viewer's context column, in order." },
    "kind": { "enum": ["item", "collection", "tag"], "description": "What the card is; absent means item." },
    "media_type": { "enum": ["photo", "gif", "video"], "description": "What the item shows." },
    "unplayable": {
      "type": "object",
      "required": ["provider"],
      "properties": { "provider": { "type": "string" } },
      "description": "Set when the video is an embed that cannot play in WebGL; names the provider."
    },
    "creator": {
      "type": "object",
      "required": ["id", "label"],
      "properties": { "id": { "type": "string" }, "label": { "type": "string" } },
      "description": "Who made the item."
    },
    "collection": {
      "type": "object",
      "required": ["id", "label"],
      "properties": { "id": { "type": "string" }, "label": { "type": "string" }, "following": { "type": "boolean" } },
      "description": "The set the item belongs to."
    },
    "tags": { "type": "array", "items": { "type": "string" }, "description": "Tags of the item." },
    "count": { "type": "integer", "minimum": 0, "description": "Number of items inside a collection or tag card." },
    "width": { "type": "integer", "minimum": 1, "description": "Pixel width of the original image." },
    "height": { "type": "integer", "minimum": 1, "description": "Pixel height of the original image." },
    "actions": {
      "type": "array",
      "uniqueItems": true,
      "items": { "type": "string", "minLength": 1 },
      "description": "Ids of the actions that apply to this item. Absent: all the feed's actions. An empty list: none."
    },
    "state": {
      "type": "object",
      "properties": { "liked": { "type": "boolean" } },
      "additionalProperties": { "type": ["boolean", "number", "string"] },
      "description": "The viewer's state for this item, by key. liked is the state of the like action."
    },
    "likes": { "type": "integer", "minimum": 0, "description": "Like count." },
    "description": { "type": "string", "description": "Longer text shown in the viewer." },
    "tag": { "type": "string", "description": "Tag name on a tag card." }
  }
}
