{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://getphonenum.com/data/country-phone-formats.schema.json",
  "title": "GetPhoneNum country phone format fixtures",
  "description": "Developer and QA test fixtures; not subscriber or reachability data",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "name",
    "version",
    "updated",
    "scope",
    "records"
  ],
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1
    },
    "version": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "updated": {
      "type": "string",
      "format": "date"
    },
    "scope": {
      "type": "string",
      "minLength": 1
    },
    "records": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "country",
          "iso2",
          "callingCode",
          "nationalPattern",
          "e164Example",
          "nationalDigits",
          "fixtureSafety",
          "sourceUrl"
        ],
        "properties": {
          "country": {
            "type": "string",
            "minLength": 1
          },
          "iso2": {
            "type": "string",
            "pattern": "^[A-Z]{2}$"
          },
          "callingCode": {
            "type": "string",
            "pattern": "^\\+[1-9]\\d{0,2}$"
          },
          "nationalPattern": {
            "type": "string",
            "minLength": 1
          },
          "e164Example": {
            "type": "string",
            "pattern": "^\\+[1-9]\\d{1,14}$"
          },
          "nationalDigits": {
            "type": "string",
            "minLength": 1
          },
          "fixtureSafety": {
            "type": "string",
            "minLength": 1
          },
          "sourceUrl": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  }
}
