{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/3dpack-ing/json-schema/3dpack-ing-solver-calculate-request-schema.json",
  "title": "Calculation Input",
  "description": "The solver's own contract. Whole numbers in any unit used consistently (millimetres and grams are usual); dimensions 1–19,999.",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/3dpack-ing-openapi.json#/components/schemas/SolverCalculateRequest",
  "required": [
    "Candidates",
    "Items"
  ],
  "properties": {
    "Candidates": {
      "minItems": 1,
      "type": "array",
      "items": {
        "required": [
          "Height",
          "Width",
          "Length"
        ],
        "type": "object",
        "properties": {
          "Height": {
            "maximum": 19999,
            "minimum": 1,
            "type": "integer"
          },
          "Width": {
            "maximum": 19999,
            "minimum": 1,
            "type": "integer"
          },
          "Length": {
            "maximum": 19999,
            "minimum": 1,
            "type": "integer"
          },
          "MaxWeight": {
            "maximum": 100000000,
            "minimum": 1,
            "type": "integer",
            "default": 0
          },
          "Stability": {
            "maximum": 100,
            "minimum": 75,
            "type": "integer",
            "default": 75
          }
        }
      }
    },
    "Items": {
      "type": "array",
      "items": {
        "minItems": 1,
        "required": [
          "Height",
          "Width",
          "Length",
          "Quantity",
          "TagOrColor"
        ],
        "type": "object",
        "properties": {
          "Height": {
            "maximum": 19999,
            "minimum": 1,
            "type": "integer"
          },
          "Width": {
            "maximum": 19999,
            "minimum": 1,
            "type": "integer"
          },
          "Length": {
            "maximum": 19999,
            "minimum": 1,
            "type": "integer"
          },
          "Quantity": {
            "maximum": 19999,
            "minimum": 1,
            "type": "integer"
          },
          "Weight": {
            "maximum": 100000000,
            "minimum": 1,
            "type": "integer",
            "default": 0
          },
          "Priority": {
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "TagOrColor": {
            "minLength": 1,
            "type": "string"
          },
          "KeepTop": {
            "type": "boolean",
            "default": false
          },
          "KeepBottom": {
            "type": "boolean",
            "default": false
          },
          "NoTop": {
            "type": "boolean",
            "default": false
          },
          "Rotation": {
            "type": "boolean",
            "default": true
          },
          "StackCapacity": {
            "minimum": 0,
            "type": "integer"
          },
          "StackWeightCapacity": {
            "minimum": 0,
            "type": "integer"
          },
          "Gap": {
            "minimum": 0,
            "type": "integer"
          }
        }
      }
    },
    "Speed": {
      "enum": [
        "Fast",
        "VeryFast",
        "Slow",
        "Instant"
      ],
      "type": "string",
      "default": "Fast"
    },
    "CalculationMode": {
      "enum": [
        "MinimizeLength",
        "MinimizeHeight"
      ],
      "type": "string",
      "default": "MinimizeLength"
    },
    "ContainerMode": {
      "type": "string",
      "description": "Reserved. The solver currently rejects an explicit value; omit this field. With no ContainerMode set, the solver packs into the best single candidate container."
    },
    "AllowMixedStack": {
      "enum": [
        "Allow",
        "Disallow"
      ],
      "type": "string",
      "default": "Allow"
    }
  }
}