{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/miro/json-schema/miro-code-widget-create-request-schema.json",
  "title": "CodeWidgetCreateRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/miro-code-widget-items-experimental-api-openapi.yml#/components/schemas/CodeWidgetCreateRequest",
  "type": "object",
  "properties": {
    "data": {
      "$ref": "#/$defs/CodeWidgetData"
    },
    "position": {
      "$ref": "#/$defs/PositionChange"
    },
    "geometry": {
      "$ref": "#/$defs/Geometry"
    },
    "parent": {
      "$ref": "#/$defs/Parent"
    }
  },
  "$defs": {
    "CodeWidgetData": {
      "type": "object",
      "description": "Contains the data properties of a code widget item, such as the code content, programming language, and display settings.",
      "properties": {
        "code": {
          "type": "string",
          "description": "The code content of the widget.",
          "maxLength": 6000
        },
        "language": {
          "type": "string",
          "description": "The programming language of the code content. Used for syntax highlighting."
        },
        "lineNumbersVisible": {
          "type": "boolean",
          "description": "Indicates whether line numbers are visible in the code widget."
        },
        "title": {
          "type": "string",
          "description": "The title of the code widget.",
          "maxLength": 100
        }
      }
    },
    "Geometry": {
      "type": "object",
      "description": "Contains geometrical information about the item, such as its width or height.",
      "properties": {
        "height": {
          "type": "number",
          "format": "double",
          "description": "Height of the item, in pixels."
        },
        "rotation": {
          "type": "number",
          "format": "double",
          "description": "Rotation angle of an item, in degrees, relative to the board. You can rotate items clockwise (right) and counterclockwise (left) by specifying positive and negative values, respectively."
        },
        "width": {
          "type": "number",
          "format": "double",
          "description": "Width of the item, in pixels."
        }
      }
    },
    "Parent": {
      "type": "object",
      "description": "Contains information about the parent frame for the item.",
      "properties": {
        "id": {
          "type": "string",
          "format": "int64",
          "description": "Unique identifier (ID) of the parent frame for the item."
        }
      }
    },
    "PositionChange": {
      "type": "object",
      "description": "Contains information about the item's position on the board, such as its `x` coordinate, `y` coordinate, and the origin of the `x` and `y` coordinates.",
      "properties": {
        "x": {
          "type": "number",
          "format": "double",
          "description": "X-axis coordinate of the location of the item on the board.\nBy default, all items have absolute positioning to the board, not the current viewport. Default: `0`.\nThe center point of the board has `x: 0` and `y: 0` coordinates.",
          "default": 0
        },
        "y": {
          "type": "number",
          "format": "double",
          "description": "Y-axis coordinate of the location of the item on the board.\nBy default, all items have absolute positioning to the board, not the current viewport. Default: `0`.\nThe center point of the board has `x: 0` and `y: 0` coordinates.",
          "default": 0
        }
      }
    }
  }
}