{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Региональные маршрутизаторы паллиативной помощи: только ссылки и номер из открытых материалов",
  "type": "object",
  "properties": {
    "dataset": { "const": "routers" },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "region_ids", "title", "operator", "url", "number", "tel", "number_label", "not_affiliated",
                     "source_title", "source_url", "retrieved_at", "source_ref", "verified", "verified_at"],
        "properties": {
          "id": { "type": "string", "pattern": "^[a-z0-9-]+$" },
          "region_ids": { "type": "array", "minItems": 1, "items": { "type": "string", "pattern": "^RU-[A-Z]{2,3}$" } },
          "title": { "type": "string", "minLength": 1 },
          "operator": { "enum": ["gov", "ngo"] },
          "url": { "type": "string", "pattern": "^https://" },
          "number": { "type": "string" },
          "tel": { "type": ["string", "null"], "pattern": "^\\+7\\d{10}$" },
          "number_label": { "type": "string" },
          "not_affiliated": { "type": "boolean", "const": true },
          "source_title": { "type": "string", "minLength": 1 },
          "source_url": { "type": "string", "pattern": "^https://" },
          "retrieved_at": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
          "source_ref": { "type": "string", "minLength": 1 },
          "verified": { "type": "boolean" },
          "verified_at": { "type": ["string", "null"], "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }
        }
      }
    }
  }
}
