{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://gxplex.com/api/v1/schema/series-index.json",
  "title": "Observation series index",
  "description": "The document served at /api/v1/series.json: every period shard of the observation series, oldest first, with its window, address, size, SHA-256 and record count, and the series' totals.",
  "type": "object",
  "properties": {
    "schema_version": {
      "type": "integer",
      "description": "Always 1 under this contract. It increments only when a field is removed or re-typed, which the published contract forbids. Fields have been re-typed with this value unchanged; https://gxplex.com/how/schemas/#history lists each with its commit and its correction."
    },
    "collection": {
      "type": "string",
      "description": "Always `series-index`."
    },
    "generated_at": {
      "type": "string",
      "format": "date",
      "description": "The day this record calls today, at day granularity. Not a build clock: the unit of this archive is the day."
    },
    "source": {
      "type": "string",
      "description": "The origin this document was built for."
    },
    "notice": {
      "type": "string",
      "description": "What this record reports, and what it does not."
    },
    "source_terms": {
      "type": "string",
      "description": "A statement of fact about the compiled content. It is not a licence and grants nothing."
    },
    "rights": {
      "type": "object",
      "description": "Where the terms position of each row is recorded, what each value of licence_class means in terms of this archive handling, and the word ceiling every published quotation is held under."
    },
    "granularity": {
      "type": "string",
      "description": "The rule that sets a shard's window."
    },
    "ceiling_bytes": {
      "type": "integer",
      "description": "The per-file ceiling of the hosting platform, in bytes, which the window rule is read against."
    },
    "records": {
      "type": "integer",
      "description": "The number of records across every shard."
    },
    "sources": {
      "type": "integer",
      "description": "The number of store directories the records were read from."
    },
    "first_observation": {
      "type": [
        "string",
        "null"
      ],
      "description": "The earliest observation day in the series, or null where it holds none."
    },
    "last_observation": {
      "type": [
        "string",
        "null"
      ],
      "description": "The latest observation day in the series, or null where it holds none."
    },
    "spec": {
      "type": "string",
      "description": "The address of the spec that states what a record means."
    },
    "response_provenance": {
      "type": "object",
      "description": "The build id, the day’s root over every observation digest, where the rights envelope is carried, the class of every key a row carries, the row fields that state a row’s own basis, and the fields that carry the third-party marker. The classes and the marker are defined under `x-gxplex-basis-vocabulary` and `x-gxplex-third-party-marker` in this document."
    },
    "partitions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "window": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "bytes": {
            "type": "integer",
            "minimum": 0
          },
          "sha256": {
            "type": "string"
          },
          "records": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "window",
          "url",
          "bytes",
          "sha256",
          "records"
        ],
        "additionalProperties": true
      },
      "description": "One entry per shard, oldest first: `window` (YYYY-MM, or YYYY-Www for an ISO week), `url`, `bytes` and `sha256` of the bytes served at `url`, and `records`, the record lines after the shard's header line."
    }
  },
  "required": [
    "schema_version",
    "collection",
    "generated_at",
    "source",
    "notice",
    "source_terms",
    "rights",
    "records",
    "partitions"
  ],
  "additionalProperties": true
}
