{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/market-category-booster-com/json-schema/market-category-booster-com-product-categorization-out-schema.json",
  "title": "ProductCategorizationOut",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/market-category-booster-com-openapi.json#/components/schemas/ProductCategorizationOut",
  "properties": {
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "product_name": {
      "type": "string",
      "title": "Product Name"
    },
    "categories": {
      "items": {
        "$ref": "#/$defs/CategoryMatch"
      },
      "type": "array",
      "title": "Categories"
    },
    "store_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Store Id"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "feedback_rating": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Feedback Rating"
    }
  },
  "type": "object",
  "required": [
    "id",
    "product_name",
    "categories",
    "created_at"
  ],
  "$defs": {
    "CategoryMatch": {
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Id",
          "description": "Category identifier in the target taxonomy"
        },
        "category": {
          "type": "string",
          "title": "Category",
          "description": "Category name as it appears in the taxonomy"
        },
        "reason": {
          "type": "string",
          "title": "Reason",
          "description": "Why the model picked this category"
        },
        "level": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Level",
          "description": "Zero-based depth in the taxonomy tree; null on legacy records"
        },
        "truncated": {
          "type": "boolean",
          "title": "Truncated",
          "description": "True on the last match when the per-request token budget stopped the descent: the path is valid but not necessarily a leaf",
          "default": false
        }
      },
      "type": "object",
      "required": [
        "category",
        "reason"
      ],
      "title": "CategoryMatch",
      "description": "One level of the taxonomy descent: the category matched at that depth."
    }
  }
}