{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://gxplex.com/api/v1/schema/crawlability.json",
  "title": "Crawlability row document",
  "description": "The document served at /api/v1/crawlability.json. Items are carried under `items`.",
  "type": "object",
  "allOf": [
    {
      "$ref": "https://gxplex.com/api/v1/schema/envelope.json"
    }
  ],
  "properties": {
    "collection": {
      "const": "crawlability"
    },
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/item"
      },
      "description": "Every crawlability row this document carries."
    }
  },
  "required": [
    "items"
  ],
  "additionalProperties": true,
  "$defs": {
    "item": {
      "type": "object",
      "title": "Crawlability row",
      "description": "How a publisher host answered this archive, per row. A fact about the host and the fetch, never about the document.",
      "properties": {
        "licence_class": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "open",
            "restricted",
            "unknown",
            null
          ],
          "description": "What this archive recorded of the terms the source states. Null where no reading exists for this object. See `rights` on the envelope."
        },
        "text_retained": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether normalised prose of the document is held here for a quotation to be checked against. Held, never served. Null where no reading exists."
        },
        "quote_allowed": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether a quotation from the document appears in this record's own published output. A fact about this record's handling, not a reading of what the publisher permits, and not a grant. Null where no reading exists."
        },
        "snapshot_available": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether a retained snapshot of an observed retrieval is still held here for a digest to be re-checked against. No snapshot is served. Null where no reading exists."
        },
        "rights_of": {
          "type": [
            "string",
            "null"
          ],
          "description": "The tracked entry id the four fields above are the rights OF. Null where the object names no entry."
        },
        "rights_unresolved": {
          "type": [
            "string",
            "null"
          ],
          "description": "Present only where the four fields are null, naming which absence it is: an id this record does not hold, or an object that names no entry."
        },
        "instrument_id": {
          "type": "string",
          "description": "The row this measurement was taken for."
        },
        "authority": {
          "type": "string",
          "description": "The publishing body."
        },
        "url": {
          "type": "string",
          "description": "The address measured."
        },
        "checked": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "The day the measurement was taken."
        },
        "crawlable": {
          "type": "string",
          "enum": [
            "yes",
            "partial",
            "no",
            "unmeasured"
          ],
          "description": "The census reading of whether the address answered a plain fetch, in its own words: yes, partial or no for an address it read, and unmeasured for one it made no request to."
        },
        "render_mode": {
          "type": [
            "string",
            "null"
          ],
          "description": "Whether the content arrived in the response or required a browser."
        },
        "requires_js": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether the content is absent without script execution."
        },
        "blocks_ai_agents": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "A declared or observed exclusion of automated agents."
        },
        "browser_blocked_agent_allowed": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Where the two client profiles were answered differently."
        },
        "robots_policy": {
          "type": [
            "string",
            "null"
          ],
          "description": "The state the robots read resolved to."
        },
        "browser_status": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The status returned to the browser profile."
        },
        "agent_status": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The status returned to the declared agent profile."
        }
      },
      "required": [
        "instrument_id",
        "url",
        "licence_class",
        "text_retained",
        "quote_allowed",
        "snapshot_available",
        "rights_of"
      ],
      "additionalProperties": true
    }
  }
}
