{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/snaplab-dev/json-schema/snaplab-dev-image-options-schema.json",
  "title": "ImageOptions",
  "description": "Fixed-canvas rendering for social/OG cards. Requires `html` or `template`.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/snaplab-dev-openapi.json#/components/schemas/ImageOptions",
  "type": "object",
  "properties": {
    "html": {
      "type": "string",
      "maxLength": 2000000
    },
    "template": {
      "type": "string",
      "maxLength": 2000000,
      "description": "HTML with `{{ placeholders }}`, substituted from `data` and HTML-escaped."
    },
    "data": {
      "type": "object",
      "additionalProperties": true
    },
    "css": {
      "type": "string",
      "maxLength": 500000
    },
    "width": {
      "type": "integer",
      "minimum": 120,
      "maximum": 3840,
      "default": 1200
    },
    "height": {
      "type": "integer",
      "minimum": 120,
      "maximum": 4320,
      "default": 630
    },
    "deviceScaleFactor": {
      "type": "number",
      "minimum": 0.5,
      "maximum": 3,
      "default": 2
    },
    "format": {
      "type": "string",
      "enum": [
        "png",
        "jpeg",
        "webp"
      ],
      "default": "png"
    },
    "quality": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "googleFonts": {
      "type": "string",
      "maxLength": 300
    },
    "darkMode": {
      "oneOf": [
        {
          "type": "boolean"
        },
        {
          "type": "string",
          "enum": [
            "prefers",
            "force"
          ]
        }
      ],
      "description": "`true`/`\"force\"` darken the card even without a dark theme; `\"prefers\"` is the media query only."
    },
    "delayMs": {
      "type": "integer",
      "minimum": 0,
      "maximum": 30000
    },
    "cache": {
      "type": "boolean",
      "default": true
    },
    "responseType": {
      "type": "string",
      "enum": [
        "binary",
        "json"
      ],
      "default": "binary"
    }
  },
  "additionalProperties": false
}