{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/citoapi/json-schema/citoapi-qr-generate-body-schema.json",
  "title": "QrGenerateBody",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/citoapi-qr-code-api-openapi.yml#/components/schemas/QrGenerateBody",
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "string",
      "description": "Text or URL to encode into the QR code.",
      "maxLength": 2048
    },
    "size": {
      "type": "integer",
      "description": "Output image size in pixels (width = height).",
      "default": 300,
      "minimum": 100,
      "maximum": 2000
    },
    "format": {
      "type": "string",
      "description": "Output format.",
      "enum": [
        "png",
        "svg",
        "base64"
      ],
      "default": "png"
    },
    "foreground": {
      "type": "string",
      "description": "Foreground (dark module) hex color.",
      "default": "#000000"
    },
    "background": {
      "type": "string",
      "description": "Background hex color.",
      "default": "#ffffff"
    },
    "margin": {
      "type": "integer",
      "description": "Quiet zone width in modules.",
      "default": 4,
      "minimum": 0,
      "maximum": 10
    },
    "errorCorrection": {
      "type": "string",
      "description": "Error correction level. Automatically forced to H when a logo is provided.",
      "enum": [
        "L",
        "M",
        "Q",
        "H"
      ],
      "default": "M"
    },
    "logo": {
      "type": "object",
      "description": "Optional logo to overlay in the center of the QR code. Requires error correction H (set automatically).",
      "required": [
        "image"
      ],
      "properties": {
        "image": {
          "type": "string",
          "description": "Base64-encoded image with data URL prefix (e.g. data:image/png;base64,...)."
        },
        "sizeRatio": {
          "type": "number",
          "description": "Logo size as a fraction of the QR code size. Capped at 0.35 to preserve scannability.",
          "default": 0.25,
          "minimum": 0.1,
          "maximum": 0.35
        },
        "padding": {
          "type": "integer",
          "description": "White padding around the logo in pixels.",
          "default": 8,
          "minimum": 0,
          "maximum": 50
        }
      }
    }
  }
}