{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentstack-tech/json-schema/agentstack-tech-batch-response-schema.json",
  "title": "BatchResponse",
  "description": "Ответ батча",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentstack-tech-batch-api-openapi.yml#/components/schemas/BatchResponse",
  "properties": {
    "success": {
      "type": "boolean",
      "title": "Success"
    },
    "results": {
      "items": {
        "$ref": "#/$defs/BatchResponseItem"
      },
      "type": "array",
      "title": "Results"
    },
    "total": {
      "type": "integer",
      "title": "Total"
    },
    "successful": {
      "type": "integer",
      "title": "Successful"
    },
    "failed": {
      "type": "integer",
      "title": "Failed"
    },
    "diagnostics": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Diagnostics",
      "description": "Aggregate timing / dedup hints (optional)"
    }
  },
  "type": "object",
  "required": [
    "success",
    "results",
    "total",
    "successful",
    "failed"
  ],
  "$defs": {
    "BatchResponseItem": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "status": {
          "type": "integer",
          "title": "Status"
        },
        "data": {
          "title": "Data"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error"
        },
        "error_details": {
          "anyOf": [
            {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error Details"
        },
        "latency_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Latency Ms",
          "description": "Sub-request latency (ms)"
        }
      },
      "type": "object",
      "required": [
        "id",
        "status",
        "data"
      ],
      "title": "BatchResponseItem",
      "description": "Результат одного запроса"
    }
  }
}