{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/osis-co/json-schema/osis-co-chat-backdrop-request-schema.json",
  "title": "ChatBackdropRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/osis-co-conversations-api-openapi.yml#/components/schemas/ChatBackdropRequest",
  "oneOf": [
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "colors"
      ],
      "properties": {
        "type": {
          "const": "gradient",
          "type": "string"
        },
        "colors": {
          "type": "array",
          "minItems": 2,
          "maxItems": 8,
          "items": {
            "type": "string",
            "pattern": "^#[0-9A-Fa-f]{6}$"
          }
        }
      },
      "title": "Gradient"
    },
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "const": "clear",
          "type": "string"
        }
      },
      "title": "Clear"
    },
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "image_base64",
        "content_type"
      ],
      "properties": {
        "type": {
          "const": "image",
          "type": "string"
        },
        "image_base64": {
          "type": "string",
          "format": "byte",
          "minLength": 4,
          "maxLength": 4194304,
          "description": "The image file as plain base64, with no data: prefix. Up to 3 MiB."
        },
        "content_type": {
          "type": "string",
          "enum": [
            "image/jpeg",
            "image/png",
            "image/webp"
          ]
        },
        "crop": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "x",
            "y",
            "width",
            "height"
          ],
          "description": "Which part of the image to use, as fractions from 0 to 1, after EXIF rotation. x + width and y + height can't go over 1. Defaults to the whole image.",
          "properties": {
            "x": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "y": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "width": {
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 1
            },
            "height": {
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 1
            }
          }
        },
        "position": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "x",
            "y"
          ],
          "description": "What stays in view if the image needs trimming to fit the portrait frame: 0 is left or top, 0.5 is center, 1 is right or bottom. Defaults to center.",
          "properties": {
            "x": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "default": 0.5
            },
            "y": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "default": 0.5
            }
          }
        }
      },
      "title": "Image"
    }
  ]
}