{
  "$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-schema.json",
  "title": "Product",
  "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/Product",
  "properties": {
    "name": {
      "type": "string",
      "title": "Name",
      "description": "Product name"
    },
    "categories": {
      "items": {
        "$ref": "#/$defs/CategoryMatch"
      },
      "type": "array",
      "title": "Categories",
      "description": "One match per taxonomy level, from broadest to most specific. The last item may carry truncated=true"
    },
    "judge_approved": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Judge Approved",
      "description": "Whether a separate LLM judge confirmed the final category path is consistent with the description; null when the token budget ran out before the judge could run"
    },
    "judge_reason": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Judge Reason",
      "description": "The judge's stated reason for its verdict on the final path; null when the judge did not run or the final path was never judged"
    }
  },
  "type": "object",
  "required": [
    "name",
    "categories"
  ],
  "$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."
    }
  }
}