{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/insurers-global/json-schema/insurers-global-country-detail-schema.json",
  "title": "CountryDetail",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/insurers-global-openapi.json#/components/schemas/CountryDetail",
  "type": "object",
  "properties": {
    "slug": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "continent": {
      "type": "string",
      "enum": [
        "africa",
        "europe",
        "asia-pacific",
        "south-america",
        "north-america"
      ]
    },
    "iso2": {
      "type": [
        "string",
        "null"
      ]
    },
    "iso3": {
      "type": [
        "string",
        "null"
      ]
    },
    "isoNum": {
      "type": [
        "string",
        "null"
      ]
    },
    "composite": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "ISO alpha-2 codes of the jurisdictions a composite market combines"
    },
    "region": {
      "type": "string"
    },
    "regulator": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "acronym": {
          "type": "string"
        },
        "website": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "regime": {
          "type": [
            "string",
            "null"
          ]
        },
        "registerSource": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "currency": {
      "type": "string"
    },
    "currencies": {
      "type": "array",
      "description": "ISO 4217 currencies of the market, primary first; empty for composite markets whose members share none. usdRate is local units per US dollar, year-average, from the World Bank (CC BY 4.0), or null where no series is published.",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "ISO 4217"
          },
          "name": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          },
          "decimalDigits": {
            "type": "integer"
          },
          "countries": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "usdRate": {
            "type": [
              "number",
              "null"
            ]
          },
          "usdRateYear": {
            "type": [
              "integer",
              "null"
            ]
          },
          "rateSource": {
            "type": [
              "string",
              "null"
            ]
          },
          "rateLicence": {
            "type": [
              "string",
              "null"
            ]
          },
          "rateSeen": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          }
        }
      }
    },
    "total": {
      "type": "integer"
    },
    "byClass": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      },
      "description": "Counts by class count entities, not licences: every company appears once, under the class its register row records, and byClass sums to total. A regulator’s own per-class licence tally is broader and will not match."
    },
    "byGroupType": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    },
    "verification": {
      "type": "object",
      "properties": {
        "level": {
          "type": "string",
          "enum": [
            "verified",
            "partial",
            "unverified"
          ]
        },
        "basis": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "register",
            "statute",
            null
          ],
          "description": "What the rows were checked against: the supervisor’s register, or, where no register is published, the statute that provides for the insurers. Null when unverified."
        },
        "status": {
          "type": "string"
        },
        "source": {
          "type": [
            "string",
            "null"
          ]
        },
        "corrections": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "marketNotes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "event": {
            "type": "string"
          },
          "effect": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "api": {
      "type": "string",
      "format": "uri"
    },
    "insurersApi": {
      "type": "string",
      "format": "uri",
      "description": "Full insurer list for this market"
    },
    "insurersPagesApi": {
      "type": "string",
      "format": "uri",
      "description": "First page of the market's insurers, 25 a page"
    },
    "insurers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/InsurerSummary"
      }
    }
  },
  "$defs": {
    "InsurerSummary": {
      "type": "object",
      "description": "Abbreviated register entity retaining verification, source and classification caveats",
      "properties": {
        "slug": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "class": {
          "type": "string",
          "description": "Class of business slug"
        },
        "classCode": {
          "type": "string",
          "enum": [
            "G",
            "L",
            "C",
            "R",
            "T",
            "M",
            "X",
            "F",
            "H",
            "U"
          ],
          "description": "U = class not stated in the source register"
        },
        "group": {
          "type": "string",
          "description": "Parent / group text as the register records it. \"Independent\" when the register records no parent company. Read it as a parent organisation only when groupPlaceholder is false."
        },
        "groupSlug": {
          "type": [
            "string",
            "null"
          ]
        },
        "groupPlaceholder": {
          "type": "boolean",
          "description": "True when group does not name a parent organisation: the register recorded none and the value is an ownership style, a status, a NAIC group code, a domicile or a description of the entity. Absence of a parent is not evidence of independence."
        },
        "groupType": {
          "type": "string"
        },
        "verification": {
          "type": "string",
          "enum": [
            "verified",
            "partial",
            "unverified"
          ]
        },
        "sourceBasis": {
          "type": "string"
        },
        "classBasis": {
          "type": [
            "string",
            "null"
          ],
          "description": "How the class was determined"
        },
        "groupBasis": {
          "type": [
            "string",
            "null"
          ],
          "description": "How the parent or group was determined"
        },
        "lei": {
          "type": [
            "string",
            "null"
          ],
          "description": "LEI where the register carries it"
        },
        "nationalId": {
          "type": [
            "string",
            "null"
          ],
          "description": "National register identifier if available"
        },
        "notes": {
          "type": [
            "string",
            "null"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      },
      "required": [
        "slug",
        "name",
        "country",
        "class",
        "verification",
        "sourceBasis",
        "classBasis",
        "groupBasis",
        "lei",
        "nationalId"
      ]
    }
  }
}