{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "additionalProperties": false,
  "required": ["name", "plugins"],
  "properties": {
    "name": { "type": "string", "minLength": 1 },
    "interface": {
      "type": "object",
      "additionalProperties": false,
      "required": ["displayName"],
      "properties": { "displayName": { "type": "string", "minLength": 1 } }
    },
    "plugins": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["name", "source", "policy", "category"],
        "properties": {
          "name": { "type": "string", "minLength": 1 },
          "source": {
            "type": "object",
            "additionalProperties": false,
            "required": ["source", "path"],
            "properties": {
              "source": { "const": "local" },
              "path": { "type": "string", "pattern": "^\\./" }
            }
          },
          "policy": {
            "type": "object",
            "additionalProperties": false,
            "required": ["installation", "authentication"],
            "properties": {
              "installation": { "enum": ["AVAILABLE", "REQUIRED", "DISALLOWED"] },
              "authentication": { "enum": ["ON_INSTALL", "ON_USE", "NONE"] }
            }
          },
          "category": { "type": "string", "minLength": 1 }
        }
      }
    }
  }
}
