{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://tattletab.net/schema.json",
  "title": "tattletab report",
  "description": "A browser report from tattletab: what one browser supports and exposes. Entries a user hid have status \"redacted\" and no value.",
  "type": "object",
  "required": [
    "format",
    "tool",
    "createdAt",
    "entries"
  ],
  "properties": {
    "format": {
      "const": "tattletab/v1"
    },
    "tool": {
      "type": "object",
      "required": [
        "version",
        "layer"
      ],
      "properties": {
        "version": {
          "type": "string",
          "description": "Version of the checks that made the report."
        },
        "layer": {
          "enum": [
            "bootstrap",
            "modern"
          ],
          "description": "\"bootstrap\": the basic checks for old browsers; \"modern\": the full checks."
        }
      }
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "context": {
      "type": "object",
      "description": "Why the report exists.",
      "properties": {
        "requestedBy": {
          "type": "string",
          "maxLength": 200,
          "description": "Who asked for it (?for= of a request link)."
        },
        "note": {
          "type": "string",
          "maxLength": 5000,
          "description": "What the user wrote."
        },
        "needs": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "type": "string",
            "maxLength": 120
          },
          "description": "Features the developer's site needs (?needs=): web-features IDs or browser-compat-data keys."
        }
      }
    },
    "entries": {
      "type": "array",
      "maxItems": 50000,
      "items": {
        "$ref": "#/$defs/entry"
      }
    }
  },
  "$defs": {
    "entry": {
      "type": "object",
      "required": [
        "id",
        "category",
        "label",
        "sensitivity",
        "status"
      ],
      "properties": {
        "id": {
          "type": "string",
          "maxLength": 200,
          "description": "Stable id, \"category.name\", e.g. \"screen.size\" or \"api.Navigator.share\"."
        },
        "category": {
          "type": "string",
          "maxLength": 50
        },
        "label": {
          "type": "string",
          "maxLength": 200,
          "description": "English label for people."
        },
        "value": {
          "description": "Any JSON value. Feature entries (categories api, js, css, html and *Syntax) hold { where?, members?, missing?, untested? }."
        },
        "sensitivity": {
          "enum": [
            "low",
            "medium",
            "high"
          ],
          "description": "How much the value identifies the person: high can single them out."
        },
        "status": {
          "enum": [
            "ok",
            "unsupported",
            "error",
            "timeout",
            "redacted"
          ],
          "description": "\"unsupported\": the feature or value doesn't exist in this browser; \"redacted\": hidden by the user."
        },
        "error": {
          "type": "string",
          "maxLength": 1000
        }
      }
    }
  }
}
