{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://vistonomadi.com/research/digital-nomad-visa-source-index.schema.json",
  "title": "VistoNomadi digital nomad visa official-source index",
  "description": "Schema for the public source-verification and review-status dataset.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "$schema",
    "name",
    "description",
    "version",
    "canonicalUrl",
    "publisher",
    "operator",
    "rightsHolder",
    "updatedAt",
    "methodology",
    "corrections",
    "citation",
    "citationGuidance",
    "records"
  ],
  "properties": {
    "$schema": { "const": "https://vistonomadi.com/research/digital-nomad-visa-source-index.schema.json" },
    "name": { "type": "string", "minLength": 10 },
    "description": { "type": "string", "minLength": 40 },
    "version": { "type": "string", "pattern": "^[0-9]{4}\\.[0-9]{2}\\.[0-9]+$" },
    "canonicalUrl": { "type": "string", "format": "uri", "pattern": "^https://vistonomadi\\.com/" },
    "publisher": { "$ref": "#/$defs/namedEntity" },
    "operator": { "$ref": "#/$defs/namedEntity" },
    "rightsHolder": { "type": "string", "minLength": 2 },
    "updatedAt": { "type": "string", "format": "date" },
    "methodology": { "type": "string", "format": "uri" },
    "corrections": { "type": "string", "format": "uri" },
    "citation": { "type": "string", "minLength": 30 },
    "citationGuidance": { "type": "string", "minLength": 40 },
    "records": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": { "$ref": "#/$defs/record" }
    }
  },
  "$defs": {
    "namedEntity": {
      "type": "object",
      "additionalProperties": false,
      "required": ["name", "url"],
      "properties": {
        "name": { "type": "string", "minLength": 2 },
        "url": { "type": "string", "format": "uri" }
      }
    },
    "record": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "slug",
        "country",
        "authority",
        "officialUrl",
        "status",
        "scope",
        "reviewedAt",
        "nextReviewAt",
        "note"
      ],
      "properties": {
        "slug": { "type": "string", "pattern": "^[a-z0-9-]+$" },
        "country": { "type": "string", "minLength": 2 },
        "authority": { "type": "string", "minLength": 2 },
        "officialUrl": { "type": "string", "format": "uri", "pattern": "^https://" },
        "status": {
          "enum": [
            "verified-official-route",
            "official-entry-point",
            "primary-source-review-needed"
          ]
        },
        "scope": { "type": "string", "minLength": 20 },
        "reviewedAt": { "type": "string", "format": "date" },
        "nextReviewAt": { "type": "string", "format": "date" },
        "note": { "type": "string", "minLength": 30 }
      }
    }
  }
}
