{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/capacities-io/json-schema/capacities-io-append-blocks-position-schema.json",
  "title": "AppendBlocksPosition",
  "description": "Position descriptor for appending blocks.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/capacities-io-openapi.json#/components/schemas/AppendBlocksPosition",
  "oneOf": [
    {
      "$ref": "#/$defs/AppendBlocksPositionEnd"
    },
    {
      "$ref": "#/$defs/AppendBlocksPositionStart"
    },
    {
      "$ref": "#/$defs/AppendBlocksPositionAfterBlock"
    }
  ],
  "type": "object",
  "$defs": {
    "AppendBlocksPositionAfterBlock": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "after_block"
          ],
          "description": "Insert immediately after the given sibling block."
        },
        "after_block": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "description": "Block id of the sibling to insert after."
            }
          },
          "required": [
            "id"
          ]
        }
      },
      "required": [
        "type",
        "after_block"
      ],
      "description": "Insert appended blocks immediately after an existing sibling block."
    },
    "AppendBlocksPositionEnd": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "end"
          ],
          "description": "Insert at the end of the parent’s child list (default)."
        }
      },
      "required": [
        "type"
      ],
      "description": "Insert appended blocks at the end of the target list."
    },
    "AppendBlocksPositionStart": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "start"
          ],
          "description": "Insert at the beginning of the parent’s child list."
        }
      },
      "required": [
        "type"
      ],
      "description": "Insert appended blocks at the beginning of the target list."
    }
  }
}