{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://opensourcestats.com/data/reconstructed-history.schema.json",
  "title": "Reconstructed repository history",
  "description": "Dated star, fork and open-issue counts reconstructed from Wayback Machine captures of GitHub repository pages. Sparse and never interpolated. These are NOT measured readings and must not be silently merged into a measured series.",
  "type": "object",
  "required": [
    "name",
    "publisher",
    "license",
    "counts",
    "points"
  ],
  "properties": {
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "publisher": {
      "type": "string"
    },
    "license": {
      "type": "string",
      "format": "uri"
    },
    "generated_at": {
      "type": "string",
      "format": "date-time"
    },
    "counts": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      },
      "description": "Number of points per metric code."
    },
    "method": {
      "type": "string"
    },
    "methods": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "limits": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "citation": {
      "type": "string"
    },
    "points": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "repo",
          "metric",
          "as_of",
          "value"
        ],
        "properties": {
          "repo": {
            "type": "string",
            "description": "GitHub repository in owner/name form, using the CURRENT name. Renamed repositories still store points captured under their previous name; the name that was captured is visible in `source`.",
            "format": "owner/name",
            "pattern": "^[^/]+/[^/]+$"
          },
          "metric": {
            "type": "string",
            "description": "Which counter the value belongs to. Never mix metrics in one series: they are different units.",
            "enum": [
              "github_stars",
              "github_forks",
              "open_issues"
            ]
          },
          "as_of": {
            "type": "string",
            "description": "The calendar day the capture represents. Not the reading time - the capture time is in `archived_at`.",
            "format": "date"
          },
          "value": {
            "type": "integer",
            "description": "The number GitHub printed on that page. Null is never stored as zero; an unreadable capture is omitted entirely."
          },
          "confidence": {
            "type": "string",
            "description": "`exact` means the counter was read directly. `beyond_cap` is reserved for the API path that stops at 40,000 stars and does not occur in archive captures.",
            "enum": [
              "exact",
              "beyond_cap"
            ]
          },
          "method": {
            "type": "string",
            "description": "How the point was obtained. Archive captures need no token and have no cap; the API method is blocked on this account.",
            "enum": [
              "wayback_repo_page",
              "stargazers_binary_search"
            ]
          },
          "source": {
            "type": "string",
            "description": "The exact archive capture the value came from. Any row can be re-checked by opening this URL - that is the point of publishing it.",
            "format": "uri"
          },
          "archived_at": {
            "type": "string",
            "description": "When the archive made the capture. Differs from `as_of` (the day it represents) when a capture happened late at night in another zone.",
            "format": "date-time"
          },
          "reconstructed": {
            "type": "boolean",
            "description": "Always true in this file. Present so a consumer cannot mistake a reconstructed point for a measured reading when merging with other data."
          }
        },
        "additionalProperties": true
      }
    }
  },
  "additionalProperties": true
}
