{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Официальные региональные акты о паллиативной помощи: только метаданные с портала официального опубликования. verified: true значит, что метаданные взяты из API портала. kind угадан словарём по названию, kind_checked ставит человек",
  "type": "object",
  "properties": {
    "dataset": { "const": "region-acts" },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "region_id", "act_type", "authority", "number", "doc_date", "publish_date", "title", "pages",
                     "url", "kind", "kind_checked", "words", "source_ref", "retrieved_at", "verified", "verified_at"],
        "properties": {
          "id": { "type": "string", "pattern": "^\\d{16}$", "x-message-ru": "id - это eoNumber, 16 цифр" },
          "region_id": { "type": "string", "pattern": "^RU-[A-Z]{2,3}$" },
          "act_type": { "type": "string" },
          "authority": { "type": "string" },
          "number": { "type": "string" },
          "doc_date": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
          "publish_date": { "type": "string", "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$" },
          "title": { "type": "string", "minLength": 1 },
          "pages": { "type": "integer", "minimum": 0 },
          "url": { "type": "string", "pattern": "^http://publication\\.pravo\\.gov\\.ru/document/\\d{16}$" },
          "kind": { "enum": ["program", "organization", "routing", "reimbursement", "nutrition", "devices", "subsidy", "other"] },
          "kind_checked": { "type": "boolean" },
          "words": { "type": "array", "minItems": 1, "items": { "type": "string" } },
          "source_ref": { "const": "pravo-api" },
          "retrieved_at": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
          "verified": { "type": "boolean" },
          "verified_at": { "type": ["string", "null"], "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }
        }
      }
    }
  }
}
