{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/astranexo-com/json-schema/astranexo-com-tariff-code-detail-schema.json",
  "title": "TariffCodeDetail",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/astranexo-com-cat-logos-api-openapi.yml#/components/schemas/TariffCodeDetail",
  "allOf": [
    {
      "$ref": "#/$defs/TariffCode"
    },
    {
      "type": "object",
      "properties": {
        "parent_code": {
          "type": [
            "string",
            "null"
          ]
        },
        "children": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TariffCode"
          }
        }
      }
    }
  ],
  "$defs": {
    "TariffCode": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "code": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "chapter": {
          "type": [
            "string",
            "null"
          ]
        },
        "heading": {
          "type": [
            "string",
            "null"
          ]
        },
        "level": {
          "type": "integer"
        },
        "is_leaf": {
          "type": "boolean",
          "description": "Partida final, utilizable en un comprobante."
        },
        "rank": {
          "type": "number",
          "description": "Relevancia (solo en búsquedas)."
        }
      }
    }
  }
}