{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/healthrecordrights-com/json-schema/healthrecordrights-com-envelope-schema.json",
  "title": "Envelope",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/healthrecordrights-com-openapi.json#/components/schemas/Envelope",
  "type": "object",
  "properties": {
    "api": {
      "const": "v1"
    },
    "version": {
      "type": "string",
      "description": "The index (data) version, like 1.0. Not the API version, which is api."
    },
    "asOf": {
      "type": "string",
      "format": "date",
      "description": "The release date of the data, the same on every route. A country or state also carries its own date in data."
    },
    "dataSha256": {
      "type": "string",
      "description": "The release hash: SHA-256 of the country files behind the scores; the paper records the same hash. State answers are covered by statesSha256."
    },
    "statesSha256": {
      "type": "string",
      "description": "State routes only: SHA-256 of the state files."
    },
    "casesSha256": {
      "type": "string",
      "description": "Country and case routes: SHA-256 of the real cases, which the weekly refresh can change while dataSha256 stays the same."
    },
    "casesAsOf": {
      "type": "string",
      "format": "date",
      "description": "Country and case routes: the day the real cases last changed (a case added or taken off), from the changes journal. The index asOf is the data date and stays separate."
    },
    "license": {
      "$ref": "#/$defs/License"
    },
    "citation": {
      "type": "string",
      "description": "How to cite the index."
    },
    "pageUrl": {
      "type": "string",
      "description": "The page on healthrecordrights.com that shows the same thing."
    },
    "data": {}
  },
  "required": [
    "api",
    "version",
    "asOf",
    "dataSha256",
    "license",
    "citation",
    "pageUrl",
    "data"
  ],
  "$defs": {
    "License": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "credit": {
          "type": "string"
        },
        "covers": {
          "type": "string"
        },
        "excludes": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "url",
        "credit"
      ]
    }
  }
}