{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "formats_v0": {
      "description": "CIDs of the full-size (512px-class) blobs stored in the sticker owner's repo under blue.moji.collection.item stickerFormats. CID-only, like blue.moji.richtext.facet#formats_v1, because blobs cannot be referenced across repos.",
      "properties": {
        "apng_512": {
          "format": "cid",
          "type": "string"
        },
        "gif_512": {
          "format": "cid",
          "type": "string"
        },
        "lottie": {
          "format": "cid",
          "type": "string"
        },
        "png_512": {
          "format": "cid",
          "type": "string"
        },
        "webp_512": {
          "format": "cid",
          "type": "string"
        }
      },
      "type": "object"
    },
    "main": {
      "description": "A full-sized Bluemoji sticker attached to a post as media, in the style of app.bsky.embed.external. References a blue.moji.collection.item record in the sticker owner's repo.",
      "properties": {
        "sticker": {
          "ref": "#sticker",
          "type": "ref"
        }
      },
      "required": [
        "sticker"
      ],
      "type": "object"
    },
    "sticker": {
      "description": "SECURITY: did/name/formats are self-attested by the posting client, like blue.moji.richtext.facet. Verify against the record strongRef (or by re-deriving the rkey from name and looking up did's blue.moji.collection.item) before rendering an image, if the render surface matters for trust.",
      "properties": {
        "alt": {
          "description": "Alt text description of the sticker, for accessibility.",
          "type": "string"
        },
        "aspectRatio": {
          "ref": "app.bsky.embed.defs#aspectRatio",
          "type": "ref"
        },
        "did": {
          "description": "DID of the repo that owns the sticker record. Combined with the format CIDs to construct blob/CDN URLs without a getRecord round-trip, mirroring blue.moji.richtext.facet. Self-attested; see security note on this object.",
          "format": "did",
          "type": "string"
        },
        "formats": {
          "closed": false,
          "description": "CIDs of the full-size sticker renditions. Open union to allow future formats.",
          "refs": [
            "#formats_v0"
          ],
          "type": "union"
        },
        "name": {
          "description": "Colon-wrapped alias of the source Bluemoji (e.g. :blobcat:). Implementers should use this as fallback text when assets are unavailable.",
          "type": "string"
        },
        "record": {
          "description": "Strong reference to the source blue.moji.collection.item record. Use this as the verification anchor: resolve it and compare formats before trusting this embed's claims.",
          "ref": "com.atproto.repo.strongRef",
          "type": "ref"
        }
      },
      "required": [
        "did",
        "name",
        "formats"
      ],
      "type": "object"
    },
    "view": {
      "properties": {
        "sticker": {
          "ref": "#viewSticker",
          "type": "ref"
        }
      },
      "required": [
        "sticker"
      ],
      "type": "object"
    },
    "viewSticker": {
      "properties": {
        "alt": {
          "type": "string"
        },
        "aspectRatio": {
          "ref": "app.bsky.embed.defs#aspectRatio",
          "type": "ref"
        },
        "fullsize": {
          "description": "Fully-qualified URL of the full-size sticker asset.",
          "format": "uri",
          "type": "string"
        },
        "labels": {
          "description": "AppViews producing this view MUST populate labels (and reflect the source item's adultOnly) from the verified blue.moji.collection.item record, not from the embed's own self-attested fields — see the security note on #sticker. Consumers SHOULD warn or blur before rendering fullsize/thumb when present.",
          "items": {
            "ref": "com.atproto.label.defs#label",
            "type": "ref"
          },
          "type": "array"
        },
        "name": {
          "type": "string"
        },
        "record": {
          "ref": "com.atproto.repo.strongRef",
          "type": "ref"
        },
        "thumb": {
          "description": "URL of the 128px inline-emoji rendition, if available.",
          "format": "uri",
          "type": "string"
        }
      },
      "required": [
        "fullsize",
        "name"
      ],
      "type": "object"
    }
  },
  "id": "blue.moji.embed.sticker",
  "lexicon": 1
}
