{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/collager-ai/json-schema/collager-ai-layout-schema.json",
  "title": "Layout",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/collager-ai-openapi.yml#/components/schemas/Layout",
  "type": "object",
  "required": [
    "object",
    "mosaic_id",
    "width",
    "height",
    "tile_count",
    "tiles"
  ],
  "properties": {
    "object": {
      "type": "string",
      "const": "layout"
    },
    "mosaic_id": {
      "type": "string"
    },
    "width": {
      "type": "integer"
    },
    "height": {
      "type": "integer"
    },
    "tile_count": {
      "type": "integer"
    },
    "levels": {
      "type": "integer"
    },
    "tiles": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "x",
          "y",
          "w",
          "h",
          "level"
        ],
        "properties": {
          "photo": {
            "type": [
              "integer",
              "null"
            ],
            "description": "0-based position of the photo in your request (main image first, then featured, secondary and tile_image_urls)."
          },
          "source_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "x": {
            "type": "integer"
          },
          "y": {
            "type": "integer"
          },
          "w": {
            "type": "integer"
          },
          "h": {
            "type": "integer"
          },
          "level": {
            "type": "integer",
            "description": "1 = largest tiles."
          },
          "featured": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "gold",
              "silver",
              null
            ]
          },
          "avg_color": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    }
  }
}