{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aginera-ai/json-schema/aginera-ai-taxonomy-schema.json",
  "title": "Taxonomy",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aginera-ai-reference-api-openapi.yml#/components/schemas/Taxonomy",
  "type": "object",
  "properties": {
    "version": {
      "type": "string"
    },
    "trades": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "$ref": "#/$defs/Trade"
          },
          "name": {
            "type": "string"
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "item_types": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "default_unit": {
                        "$ref": "#/$defs/Unit"
                      },
                      "attribute_keys": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "code",
                      "name",
                      "default_unit"
                    ]
                  }
                }
              },
              "required": [
                "code",
                "name",
                "item_types"
              ]
            }
          }
        },
        "required": [
          "code",
          "name",
          "categories"
        ]
      }
    }
  },
  "required": [
    "version",
    "trades"
  ],
  "$defs": {
    "Trade": {
      "type": "string",
      "enum": [
        "electrical",
        "mechanical",
        "plumbing",
        "fire_protection",
        "structural",
        "architectural",
        "civil",
        "process",
        "other"
      ]
    },
    "Unit": {
      "type": "string",
      "pattern": "^[A-Z0-9]{1,6}$",
      "description": "Canonical unit code from /reference/units (extensible; not a closed enum). Examples EA, LF, FT, IN, SF, SY, CF, CY, LB, TON, HR, GAL, M, MM, M2, M3, KG, T, L, LS."
    }
  }
}