{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gifsnap-com/json-schema/gifsnap-com-gif-schema.json",
  "title": "Gif",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gifsnap-com-openapi.json#/components/schemas/Gif",
  "type": "object",
  "required": [
    "id",
    "title",
    "url",
    "preview_url",
    "width",
    "height",
    "type"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "Full media URL. Keep for sending, sharing and full-quality playback; use returned URLs unchanged."
    },
    "preview_url": {
      "type": "string",
      "format": "uri",
      "description": "Poster or legacy preview, which can be static. Do not assume this URL is animated."
    },
    "width": {
      "type": "number",
      "minimum": 0
    },
    "height": {
      "type": "number",
      "minimum": 0
    },
    "type": {
      "type": "string",
      "enum": [
        "gif",
        "sticker"
      ]
    },
    "source": {
      "type": "string",
      "description": "Provider metadata returned by the catalog."
    },
    "created_at": {
      "type": "string"
    },
    "content_id": {
      "type": "string",
      "description": "Optional verified provider identity shared by known alternate encodings of the same item. Use for presentation deduplication when present; preserve the original id for lookups."
    },
    "animated_preview": {
      "$ref": "#/$defs/AnimatedPreview"
    }
  },
  "$defs": {
    "AnimatedPreview": {
      "type": "object",
      "description": "Optional verified small animation for picker grids. Use only when the renderer supports mime_type; fall back to the full url if absent or loading fails. Do not replace the selected item full url with this preview.",
      "required": [
        "url",
        "mime_type",
        "width",
        "height",
        "animated"
      ],
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "mime_type": {
          "type": "string",
          "enum": [
            "image/gif",
            "image/webp",
            "video/mp4",
            "video/webm"
          ]
        },
        "width": {
          "type": "integer",
          "minimum": 1,
          "maximum": 480
        },
        "height": {
          "type": "integer",
          "minimum": 1,
          "maximum": 480
        },
        "byte_size": {
          "type": "integer",
          "minimum": 1,
          "maximum": 524288
        },
        "animated": {
          "type": "boolean",
          "const": true
        }
      }
    }
  }
}