{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hostilo-app/json-schema/hostilo-app-create-site-request-schema.json",
  "title": "CreateSiteRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hostilo-app-openapi.json#/components/schemas/CreateSiteRequest",
  "type": "object",
  "required": [
    "site_name"
  ],
  "properties": {
    "site_name": {
      "type": "string",
      "pattern": "^[a-z0-9-]{3,30}$",
      "description": "Subdomain: 3-30 lowercase letters, digits, hyphens."
    },
    "html": {
      "type": "string",
      "description": "Optional full HTML (max 5 MB). Without html, files or template the site gets a placeholder page."
    },
    "files": {
      "type": "array",
      "minItems": 1,
      "maxItems": 300,
      "items": {
        "type": "object",
        "required": [
          "path",
          "content"
        ],
        "additionalProperties": false,
        "properties": {
          "path": {
            "type": "string",
            "description": "Path from the site root, e.g. index.html, css/style.css, img/logo.png."
          },
          "content": {
            "type": "string",
            "description": "Text content, or base64 when encoding is base64."
          },
          "encoding": {
            "type": "string",
            "enum": [
              "utf-8",
              "base64"
            ],
            "default": "utf-8"
          }
        }
      },
      "description": "Optional multi-file content (as publishFiles)."
    },
    "template": {
      "type": "string",
      "description": "Optional template slug from listTemplates, e.g. cafe-menu, local-service."
    },
    "template_variant": {
      "type": "string",
      "description": "Template variant, e.g. plumber for local-service."
    },
    "template_photos": {
      "type": "boolean",
      "description": "Default true: frames for the site owner photos (sizes shown, swapped later in the editor). false: the version without photos, with icons and illustrations, ready to publish. Only templates with photos_optional in list_templates have the version without photos."
    },
    "template_fields": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Template fields, e.g. {\"name\":\"Linden Cafe\",\"phone\":\"+48 600 100 200\"}."
    },
    "lang": {
      "$ref": "#/$defs/Lang"
    }
  },
  "$defs": {
    "Lang": {
      "type": "string",
      "enum": [
        "en",
        "pl",
        "de",
        "es",
        "fr",
        "pt",
        "zh"
      ],
      "default": "en"
    }
  }
}