{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.david-medeiros.com/data/state-medicaid-visibility.schema.json",
  "title": "State Medicaid Data Visibility archive export, version 1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "sourcePage",
    "contentReviewedOn",
    "scope",
    "limitations",
    "categories",
    "records"
  ],
  "properties": {
    "schemaVersion": {
      "const": "state-medicaid-data-visibility-1",
      "description": "Export structure version; independent of publication or review dates."
    },
    "sourcePage": {
      "type": "string",
      "minLength": 1,
      "description": "Canonical explanatory page for this archive export.",
      "format": "uri"
    },
    "contentReviewedOn": {
      "type": "string",
      "minLength": 1,
      "description": "Review date recorded in the existing source dataset; not changed when documentation is published.",
      "format": "date"
    },
    "scope": {
      "type": "string",
      "minLength": 1,
      "description": "Declared coverage and limits of the collection."
    },
    "limitations": {
      "type": "string",
      "minLength": 1,
      "description": "Interpretation and reuse limitations."
    },
    "categories": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "description"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "description": "Category identifier used by records.category."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Readable category name."
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "description": "Meaning and scope of this category."
          }
        }
      }
    },
    "records": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "jurisdiction",
          "level",
          "category",
          "recordDate",
          "status",
          "title",
          "sourceSays",
          "visibilityContext",
          "sourceName",
          "sourceUrl",
          "sourceKind",
          "limits"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "description": "Stable identifier assigned to this archive entry; not an agency finding or docket number."
          },
          "jurisdiction": {
            "type": "string",
            "minLength": 1,
            "description": "Geographic scope as described in this entry; Multiple states does not mean every state."
          },
          "level": {
            "type": "string",
            "minLength": 1,
            "description": "Whether the entry addresses multiple states or a single state.",
            "enum": [
              "multi-state",
              "state"
            ]
          },
          "category": {
            "type": "string",
            "minLength": 1,
            "description": "Identifier linking this entry to one of the categories defined in this export.",
            "enum": [
              "federal-data-submission",
              "eligibility-visibility",
              "waiting-list-visibility",
              "public-record-access",
              "reporting-framework"
            ]
          },
          "recordDate": {
            "type": "string",
            "minLength": 1,
            "description": "Date associated with the cited record, in YYYY-MM-DD form; not a claim of current conditions.",
            "format": "date"
          },
          "status": {
            "type": "string",
            "minLength": 1,
            "description": "Dated archive summary of the source-reported status, not a live agency-status feed."
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "description": "Reader-facing archive title describing the record."
          },
          "sourceSays": {
            "type": "string",
            "minLength": 1,
            "description": "Archive summary of what the cited source reports; compare the linked original before relying on it."
          },
          "visibilityContext": {
            "type": "string",
            "minLength": 1,
            "description": "Archive explanation of how the record relates to data visibility; not an official finding."
          },
          "sourceName": {
            "type": "string",
            "minLength": 1,
            "description": "Name of the cited issuer or preserved request and any identifier supplied in the entry."
          },
          "sourceUrl": {
            "type": "string",
            "minLength": 1,
            "description": "HTTPS link to the official source, or a site-relative link to a preserved request. Resolve relative links against sourcePage.",
            "format": "uri-reference",
            "pattern": "^(https://|/[^/])"
          },
          "sourceKind": {
            "type": "string",
            "minLength": 1,
            "description": "Distinguishes a federal official source, an official commission source, and a preserved public request.",
            "enum": [
              "official-federal",
              "official-commission",
              "preserved-public-request"
            ]
          },
          "limits": {
            "type": "string",
            "minLength": 1,
            "description": "What this dated entry cannot establish and cautions needed when interpreting it."
          }
        }
      }
    }
  }
}
