Skip to content

Commit e736855

Browse files
committed
docs: update comments in Route method to clarify path structure
1 parent 531dcca commit e736855

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

context.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ type routeKey struct {
2323
// Route registers a handler for the given HTTP method and path.
2424
// Paths are relative to the plugin's base URL:
2525
//
26-
// /api/v1/plugins/{pluginId}/projects/:projectId/{path}
26+
// /api/v1/plugins/{pluginId}/{path}
2727
//
28+
// Project-scoped routes should include /projects/:projectId in the path
29+
// (e.g. "/projects/:projectId/tasks/:taskId/items").
2830
// Path parameters are available via [Request.PathParam].
2931
func (c *Context) Route(method, path string, handler RouteHandler) {
3032
c.routes[routeKey{strings.ToUpper(method), path}] = handler

0 commit comments

Comments
 (0)