{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://gxplex.com/api/v1/schema/series.json",
  "type": "object",
  "title": "Observation record",
  "description": "One observation per line. Each records what a URL returned on a date: the status, the fetch method, and — only where text was retrieved — a digest of the normalised content. A record with no content_hash means nothing was retrieved; it does not mean the document was empty. The first line of the file is a header record carrying provenance.",
  "properties": {
    "instrument_id": {
      "type": "string",
      "description": "The subject the record names."
    },
    "observed_date": {
      "type": "string",
      "format": "date",
      "description": "The day observed."
    },
    "observed_at": {
      "type": "string",
      "format": "date",
      "description": "Projected to the day at the publication boundary. The stored record keeps its instant; retention is not publication."
    },
    "sequence": {
      "type": "integer",
      "description": "The nth observation of this subject on this day, counted in the order the store recorded them. The key /observations pages address a record by."
    },
    "url": {
      "type": "string",
      "description": "The address fetched."
    },
    "http_status": {
      "type": "integer",
      "description": "The status returned. It asserts transport success and never artifact identity."
    },
    "fetch_method": {
      "type": "string",
      "description": "How the fetch was made."
    },
    "content_hash": {
      "type": [
        "string",
        "null"
      ],
      "description": "Digest of the normalised content. Null where nothing was retrieved."
    },
    "previous_hash": {
      "type": [
        "string",
        "null"
      ],
      "description": "The digest this one was compared against."
    },
    "content_length": {
      "type": "integer",
      "description": "Length of the normalised content. Written as 0 wherever no digest was taken."
    },
    "raw_bytes": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Bytes in the response."
    },
    "changed": {
      "type": "boolean",
      "description": "Whether the digest differs from the one before it."
    },
    "error": {
      "type": [
        "string",
        "null"
      ],
      "description": "The transport error, where one occurred."
    },
    "ia_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "A third-party archive copy of the retrieval, where one was made."
    }
  },
  "required": [
    "instrument_id",
    "observed_date",
    "url",
    "http_status",
    "sequence"
  ],
  "additionalProperties": true
}
