{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://maw.soulbrews.studio/schema/plugin.json",
  "title": "maw plugin manifest",
  "description": "Per-plugin manifest (plugin.json at the root of a plugin repo).",
  "type": "object",
  "required": ["name", "version", "description", "author", "license", "sdk", "schemaVersion"],
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "type": "string"
    },
    "name": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]*$",
      "minLength": 2,
      "maxLength": 64
    },
    "version": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$"
    },
    "description": {
      "type": "string",
      "minLength": 4,
      "maxLength": 280
    },
    "author": {
      "type": "string",
      "minLength": 1
    },
    "license": {
      "type": "string"
    },
    "homepage": {
      "type": "string",
      "format": "uri"
    },
    "sdk": {
      "type": "string",
      "description": "Semver range of the maw-js plugin SDK the plugin targets."
    },
    "api": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "path": {
          "type": "string",
          "pattern": "^/[A-Za-z0-9_\\-/.]*$"
        },
        "methods": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "enum": ["GET", "POST", "PUT", "PATCH", "DELETE"]
          }
        }
      }
    },
    "schemaVersion": {
      "const": 1
    }
  }
}
