{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/esyurl-fyi/json-schema/esyurl-fyi-render-request-schema.json",
  "title": "RenderRequest",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/esyurl-fyi-openapi.json#/components/schemas/RenderRequest",
  "type": "object",
  "required": [
    "data"
  ],
  "additionalProperties": false,
  "properties": {
    "data": {
      "type": "string",
      "maxLength": 2048
    },
    "format": {
      "type": "string",
      "enum": [
        "png",
        "svg"
      ],
      "default": "png"
    },
    "size": {
      "type": "integer",
      "minimum": 64,
      "maximum": 2048
    },
    "margin": {
      "type": "integer",
      "minimum": 0,
      "maximum": 16
    },
    "dark": {
      "$ref": "#/$defs/HexColour"
    },
    "light": {
      "$ref": "#/$defs/HexColour"
    },
    "ecl": {
      "type": "string",
      "enum": [
        "L",
        "M",
        "Q",
        "H"
      ]
    },
    "modules": {
      "type": "string",
      "enum": [
        "square",
        "rounded",
        "dot",
        "row",
        "column"
      ],
      "description": "Shape of the data modules (default square)"
    },
    "eyeFrame": {
      "type": "string",
      "enum": [
        "square",
        "rounded",
        "circle"
      ],
      "description": "Outer ring of the three corner markers"
    },
    "eyeBall": {
      "type": "string",
      "enum": [
        "square",
        "rounded",
        "circle"
      ],
      "description": "Centre of the corner markers"
    },
    "eyeColor": {
      "$ref": "#/$defs/HexColour",
      "description": "Colour of the corner markers; defaults to dark"
    },
    "image": {
      "type": "object",
      "required": [
        "mode",
        "data"
      ],
      "additionalProperties": false,
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "logo",
            "halftone"
          ],
          "description": "logo: in the middle; halftone: a photo behind the code, drawn as dots"
        },
        "data": {
          "type": "string",
          "description": "data:image/png;base64,... (png, jpeg, webp or gif, up to 2 MB)"
        },
        "size": {
          "type": "number",
          "minimum": 0.1,
          "maximum": 0.3,
          "description": "Logo side as a share of the code (default 0.22)"
        }
      }
    }
  },
  "$defs": {
    "HexColour": {
      "type": "string",
      "pattern": "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"
    }
  }
}