{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gifsnap-com/json-schema/gifsnap-com-media-page-schema.json",
  "title": "MediaPage",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gifsnap-com-openapi.json#/components/schemas/MediaPage",
  "type": "object",
  "required": [
    "data",
    "pagination"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Gif"
      }
    },
    "pagination": {
      "$ref": "#/$defs/Pagination"
    },
    "query": {
      "type": "string"
    }
  },
  "$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
        }
      }
    },
    "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"
        }
      }
    },
    "Pagination": {
      "type": "object",
      "required": [
        "page",
        "limit",
        "total",
        "has_next",
        "next_page",
        "offset"
      ],
      "properties": {
        "page": {
          "type": "integer",
          "minimum": 1
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50
        },
        "total": {
          "type": "number",
          "minimum": 0,
          "description": "Upstream result count when supplied; otherwise an estimate from the current offset and batch. It may change between requests. Follow has_next and next_page instead of deriving continuation from total."
        },
        "has_next": {
          "type": "boolean"
        },
        "next_page": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1
        },
        "offset": {
          "type": "integer",
          "minimum": 0
        }
      }
    }
  }
}