{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/upriver-ai/json-schema/upriver-ai-categories-response-schema.json",
  "title": "CategoriesResponse",
  "description": "Response containing lists of L1 and L2 taxonomy categories.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/upriver-ai-taxonomy-api-openapi.yml#/components/schemas/CategoriesResponse",
  "properties": {
    "l1": {
      "items": {
        "$ref": "#/$defs/TaxonomyCategory"
      },
      "type": "array",
      "title": "L1",
      "description": "Top-level categories (level=1)"
    },
    "l2": {
      "items": {
        "$ref": "#/$defs/TaxonomyCategory"
      },
      "type": "array",
      "title": "L2",
      "description": "Second-level categories (level=2)"
    }
  },
  "type": "object",
  "required": [
    "l1",
    "l2"
  ],
  "$defs": {
    "TaxonomyCategory": {
      "properties": {
        "category_id": {
          "type": "string",
          "title": "Category Id",
          "description": "Stable category slug id"
        },
        "display_name": {
          "type": "string",
          "title": "Display Name",
          "description": "Human-readable name"
        },
        "level": {
          "type": "integer",
          "title": "Level",
          "description": "Hierarchy level: 1 for L1, 2 for L2"
        },
        "parent_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Parent Id",
          "description": "Parent category id (for L2 items)"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description",
          "description": "Optional description"
        },
        "aliases": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Aliases",
          "description": "Known aliases"
        }
      },
      "type": "object",
      "required": [
        "category_id",
        "display_name",
        "level"
      ],
      "title": "TaxonomyCategory",
      "description": "A single taxonomy category item (L1 or L2)."
    }
  }
}