{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "card": {
      "description": "A card entry in a decklist.",
      "properties": {
        "quantity": {
          "description": "Number of copies in the deck.",
          "minimum": 1,
          "type": "integer"
        },
        "ref": {
          "description": "Reference to the card (scryfall printing + oracle card).",
          "ref": "com.deckbelcher.defs#cardRef",
          "type": "ref"
        },
        "section": {
          "description": "Which section of the deck this card belongs to. Extensible to support format-specific sections.",
          "ref": "#section",
          "type": "ref"
        },
        "tags": {
          "description": "User annotations for this card in this deck (e.g., \"removal\", \"wincon\", \"ramp\").",
          "items": {
            "description": "A tag annotation for a card.",
            "maxGraphemes": 64,
            "maxLength": 640,
            "type": "string"
          },
          "maxLength": 128,
          "type": "array"
        }
      },
      "required": [
        "ref",
        "quantity",
        "section"
      ],
      "type": "object"
    },
    "format": {
      "description": "Game format for a deck.",
      "knownValues": [
        "standard",
        "pioneer",
        "modern",
        "legacy",
        "vintage",
        "pauper",
        "commander",
        "duel",
        "paupercommander",
        "predh",
        "oathbreaker",
        "brawl",
        "standardbrawl",
        "historic",
        "timeless",
        "alchemy",
        "gladiator",
        "premodern",
        "oldschool",
        "draft",
        "penny",
        "cube",
        "kitchentable"
      ],
      "maxGraphemes": 32,
      "maxLength": 320,
      "type": "string"
    },
    "main": {
      "description": "A Magic: The Gathering decklist.",
      "key": "tid",
      "record": {
        "properties": {
          "cards": {
            "description": "Array of cards in the decklist.",
            "items": {
              "ref": "#card",
              "type": "ref"
            },
            "type": "array"
          },
          "createdAt": {
            "description": "Timestamp when the decklist was created.",
            "format": "datetime",
            "type": "string"
          },
          "format": {
            "description": "Format of the deck.",
            "ref": "#format",
            "type": "ref"
          },
          "name": {
            "description": "Name of the decklist.",
            "maxGraphemes": 128,
            "maxLength": 1280,
            "type": "string"
          },
          "primer": {
            "description": "Deck primer with strategy, combos, and card choices.",
            "refs": [
              "com.deckbelcher.richtext#document",
              "#primerUri",
              "#primerRef"
            ],
            "type": "union"
          },
          "updatedAt": {
            "description": "Timestamp when the decklist was last updated.",
            "format": "datetime",
            "type": "string"
          }
        },
        "required": [
          "name",
          "cards",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "primerRef": {
      "description": "Primer in a separate ATProto record. For use with any longform writing lexicon.",
      "properties": {
        "ref": {
          "ref": "com.atproto.repo.strongRef",
          "type": "ref"
        }
      },
      "required": [
        "ref"
      ],
      "type": "object"
    },
    "primerUri": {
      "description": "External primer content. Typically a URL, but any valid URI scheme.",
      "properties": {
        "uri": {
          "maxGraphemes": 1000,
          "maxLength": 10000,
          "type": "string"
        }
      },
      "required": [
        "uri"
      ],
      "type": "object"
    },
    "section": {
      "description": "Which section of the deck this card belongs to. Extensible to support format-specific sections.",
      "knownValues": [
        "mainboard",
        "sideboard",
        "maybeboard",
        "commander"
      ],
      "maxGraphemes": 64,
      "maxLength": 640,
      "type": "string"
    }
  },
  "id": "com.deckbelcher.deck.list",
  "lexicon": 1
}
