{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aginera-ai/json-schema/aginera-ai-unit-list-schema.json",
  "title": "UnitList",
  "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/UnitList",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "$ref": "#/$defs/Unit"
          },
          "name": {
            "type": "string"
          },
          "measure_type": {
            "$ref": "#/$defs/MeasureType"
          },
          "system": {
            "type": "string",
            "enum": [
              "imperial",
              "metric",
              "either"
            ]
          },
          "si_factor": {
            "type": "number"
          }
        },
        "required": [
          "code",
          "name",
          "measure_type",
          "system",
          "si_factor"
        ]
      }
    }
  },
  "required": [
    "data"
  ],
  "$defs": {
    "MeasureType": {
      "type": "string",
      "enum": [
        "count",
        "length",
        "area",
        "volume",
        "weight",
        "time"
      ]
    },
    "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."
    }
  }
}