You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/configuration.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -177,7 +177,7 @@ The following properties on `MediatorConfigurationAttribute` control endpoint ge
177
177
**`EndpointRoutePrefix`** (`string?`)
178
178
179
179
-**Default:**`"api"`
180
-
-**Effect:** Sets a global route prefix that all category groups nest under. Categories auto-derive their route from their name (e.g., `[HandlerEndpointGroup("Products")]` → `products`), composing with the global prefix to produce `/api/products`.
180
+
-**Effect:** Sets a global route prefix that all category groups nest under. Categories auto-derive their route from their name (e.g., `[HandlerEndpointGroup("Products")]` → `products`), composing with the global prefix to produce `/api/products`. Convention-based entity routes are auto-pluralized (e.g., `GetProduct` → `/products/{productId}`).
181
181
-**Important:** Category-level `RoutePrefix` values without a leading `/` are **relative** to this global prefix. Don't include `api` in your category prefixes when using the default global prefix, or you'll get `/api/api/...`. Use a leading `/` on a category prefix to make it absolute (bypasses the global prefix).
182
182
-**To disable:** Set `EndpointRoutePrefix = ""` to remove the global prefix entirely, then use full paths in category prefixes.
Copy file name to clipboardExpand all lines: docs/guide/endpoints.md
+30-6Lines changed: 30 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,17 +30,17 @@ app.Run();
30
30
That's it. You now have:
31
31
32
32
```text
33
-
POST /api/product → CreateProduct
34
-
GET /api/product/{productId} → GetProduct
35
-
GET /api/product → GetProducts
36
-
PUT /api/product/{productId} → UpdateProduct
37
-
DELETE /api/product/{productId} → DeleteProduct
33
+
POST /api/products → CreateProduct
34
+
GET /api/products/{productId} → GetProduct
35
+
GET /api/products → GetProducts
36
+
PUT /api/products/{productId} → UpdateProduct
37
+
DELETE /api/products/{productId} → DeleteProduct
38
38
```
39
39
40
40
No attributes required. The source generator infers everything from your message names and properties:
41
41
42
42
-**HTTP method** — from the message name prefix (`Get*` → GET, `Create*` → POST, `Update*` → PUT, `Delete*` → DELETE, etc.)
43
-
-**Route** — from the class name (minus the `Handler`/`Consumer` suffix) and message properties (names ending in `Id` become route parameters)
43
+
-**Route** — from the message name (minus the verb prefix), **auto-pluralized** to follow REST conventions, with message properties (names ending in `Id` become route parameters)
44
44
-**Parameter binding** — ID properties go in the route, other properties become query parameters (GET/DELETE) or body (POST/PUT/PATCH)
45
45
-**OpenAPI metadata** — operation names, status codes, and even error responses are auto-detected from your `Result` factory calls
46
46
-**Result mapping** — `Result<T>` return values are automatically converted to the correct HTTP status codes
Entity names in convention-based routes are **automatically pluralized** to follow REST conventions. The entity name is extracted from the message name by removing the verb prefix (e.g., `GetProduct` → `Product`), then pluralized before being converted to kebab-case.
0 commit comments