{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://harpd.com/data/discovery-index.schema.json",
  "title": "Harpd Product Discovery Index",
  "type": "object",
  "required": [
    "schemaVersion",
    "generated_at",
    "license",
    "products"
  ],
  "properties": {
    "schemaVersion": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$"
    },
    "generated_at": {
      "type": "string",
      "format": "date-time"
    },
    "license": {
      "const": "CC BY 4.0"
    },
    "counts": {
      "type": "object"
    },
    "products": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "name",
          "domain",
          "category",
          "observed_at"
        ],
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]*$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "domain": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "category": {
            "type": "string"
          },
          "category_confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "classification_evidence": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": "string"
          },
          "github_url": {
            "type": "string"
          },
          "discovered_from": {
            "type": "string"
          },
          "completeness": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "on_rank_board": {
            "type": "boolean"
          },
          "profile_url": {
            "type": "string",
            "format": "uri"
          },
          "observed_at": {
            "type": "string"
          }
        }
      }
    }
  }
}