{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/themassprint-com/json-schema/themassprint-com-upload-validation-schema.json",
  "title": "UploadValidation",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/themassprint-com-openapi.json#/components/schemas/UploadValidation",
  "type": "object",
  "properties": {
    "upload_id": {
      "type": "string"
    },
    "validation": {
      "$ref": "#/$defs/Validation"
    }
  },
  "$defs": {
    "Issue": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "resolution": {
          "type": "string"
        }
      }
    },
    "Validation": {
      "type": "object",
      "properties": {
        "printable": {
          "type": "boolean"
        },
        "page_count": {
          "type": "integer"
        },
        "trim": {
          "type": "object",
          "properties": {
            "width_mm": {
              "type": "number"
            },
            "height_mm": {
              "type": "number"
            },
            "name": {
              "type": "string"
            }
          }
        },
        "size_bytes": {
          "type": "integer"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Issue"
          }
        },
        "warnings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Issue"
          }
        },
        "sku": {
          "type": "string",
          "description": "SKU whose rules the file best matches; top-level errors/warnings are for this SKU."
        },
        "by_sku": {
          "type": "object",
          "description": "Per-SKU verdict (the format is not declared at upload time, so the file is checked against every SKU).",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "printable": {
                "type": "boolean"
              },
              "errors": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/Issue"
                }
              },
              "warnings": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/Issue"
                }
              }
            }
          }
        }
      }
    }
  }
}