{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "/schemas/chroma-plugins/routes-manifest.schema.json",
  "title": "Chroma Router Routes Manifest",
  "description": "Route table consumed by @chroma/router bootstrapRouter via parseRoutesManifest(). Default path ./api/routes-manifest.json (see chroma-router routing.manifestPath). Consumers: Chroma/example, Chroma-CLI examples, Chroma-Server/js/chroma-router.js.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "routes": {
      "type": "array",
      "description": "Ordered list of route bindings. Multiple entries may share the same path with different handler modules (one per HTTP method file).",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["path", "module"],
        "properties": {
          "path": {
            "type": "string",
            "pattern": "^/api/",
            "description": "URL path with :param segments (derived from api/.../[param]/METHOD.js file layout).",
            "examples": ["/api/webhook", "/api/users/:id"]
          },
          "module": {
            "type": "string",
            "description": "ESM module path relative to app root exporting GET, POST, PUT, DELETE, or CUSTOM handlers.",
            "examples": [
              "./api/webhook/GET.js",
              "./api/webhook/POST.js",
              "./api/users/[id]/GET.js"
            ]
          }
        }
      }
    }
  }
}
