{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hlr-lookup/json-schema/hlr-lookup-validate-response-schema.json",
  "title": "ValidateResponse",
  "x-generated": "2026-11-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hlr-lookup-openapi.yml#/components/schemas/ValidateResponse",
  "type": "object",
  "required": [
    "results"
  ],
  "properties": {
    "results": {
      "type": "array",
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/ValidateResultItemSuccess"
          },
          {
            "$ref": "#/$defs/ResultItemError"
          }
        ]
      }
    }
  },
  "$defs": {
    "NetworkAvailability": {
      "type": "string",
      "enum": [
        "AVAILABLE",
        "NOT_AVAILABLE",
        "NOT_APPLICABLE"
      ]
    },
    "OriginalNetworkDetails": {
      "title": "OriginalNetworkDetails",
      "type": "object",
      "description": "Network that originally issued the range containing this number.",
      "properties": {
        "name": {
          "type": "string"
        },
        "mccmnc": {
          "type": "string"
        },
        "country_name": {
          "type": "string"
        },
        "country_iso3": {
          "type": "string"
        },
        "area": {
          "type": "string",
          "description": "Geographic area (may be empty for mobile ranges)."
        },
        "country_prefix": {
          "type": "string"
        }
      }
    },
    "ResultItemError": {
      "title": "ResultItemError",
      "type": "object",
      "required": [
        "error"
      ],
      "properties": {
        "error": {
          "type": "string",
          "enum": [
            "INSUFFICIENT_CREDIT",
            "INTERNAL_ERROR",
            "TOO_MANY_REQUESTS",
            "NULL_RESULT"
          ]
        }
      }
    },
    "TelephoneNumberType": {
      "type": "string",
      "enum": [
        "MOBILE",
        "LANDLINE",
        "VOIP",
        "PAGER",
        "PREMIUM",
        "TOLL_FREE",
        "SHARED_COST",
        "PERSONAL_NUMBER",
        "UNIVERSAL_ACCESS_NUMBER",
        "VOICEMAIL_ONLY",
        "STAGE_AND_SCREEN",
        "MACHINE_TO_MACHINE",
        "MSRN",
        "MOBILE_OR_LANDLINE",
        "UNKNOWN",
        "BAD_FORMAT"
      ]
    },
    "ValidateResultItemSuccess": {
      "title": "ValidateResultItemSuccess",
      "type": "object",
      "description": "Format-only result. Omits live_status, current_network*, is_ported, caching fields, ported_date, landline_status and email gateways.",
      "required": [
        "error",
        "uuid",
        "request_parameters",
        "credits_spent",
        "detected_telephone_number",
        "formatted_telephone_number",
        "telephone_number_type",
        "original_network",
        "original_network_details",
        "timestamp"
      ],
      "properties": {
        "error": {
          "type": "string",
          "const": "NONE"
        },
        "uuid": {
          "type": "string",
          "format": "uuid"
        },
        "request_parameters": {
          "type": "object",
          "properties": {
            "telephone_number": {
              "type": "string"
            },
            "input_format": {
              "type": "string"
            },
            "output_format": {
              "type": "string"
            }
          }
        },
        "credits_spent": {
          "type": "number"
        },
        "detected_telephone_number": {
          "type": "string"
        },
        "formatted_telephone_number": {
          "type": "string"
        },
        "telephone_number_type": {
          "$ref": "#/$defs/TelephoneNumberType"
        },
        "original_network": {
          "$ref": "#/$defs/NetworkAvailability"
        },
        "original_network_details": {
          "$ref": "#/$defs/OriginalNetworkDetails"
        },
        "timestamp": {
          "type": "string"
        }
      }
    }
  }
}