{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/neelsani/openipc-rs/master/apps/nebulus/presets/registry-schema-v1.json",
  "title": "Nebulus preset registry",
  "type": "object",
  "additionalProperties": false,
  "required": ["schemaVersion", "name", "presets"],
  "properties": {
    "$schema": { "type": "string", "maxLength": 256 },
    "schemaVersion": { "const": 1 },
    "name": { "type": "string", "minLength": 1, "maxLength": 96 },
    "description": { "type": "string", "maxLength": 1024, "default": "" },
    "homepage": { "type": "string", "maxLength": 2048 },
    "presets": {
      "type": "array",
      "minItems": 1,
      "maxItems": 256,
      "items": { "$ref": "#/$defs/preset" }
    }
  },
  "$defs": {
    "preset": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "version", "name", "author", "license", "downloadUrl"],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 3,
          "maxLength": 96,
          "pattern": "^[a-z0-9][a-z0-9._-]*\\.[a-z0-9._-]+$"
        },
        "version": { "type": "string", "maxLength": 32 },
        "name": { "type": "string", "minLength": 1, "maxLength": 96 },
        "author": { "type": "string", "minLength": 1, "maxLength": 96 },
        "license": { "type": "string", "minLength": 1, "maxLength": 64 },
        "description": { "type": "string", "maxLength": 1024, "default": "" },
        "downloadUrl": { "type": "string", "minLength": 1, "maxLength": 2048 },
        "sha256": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" }
      }
    }
  }
}
