Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/mediator-framework/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ public sealed class CreateOrderHandler : IRequestHandler<CreateOrderRequest, Ord
Routing/metadata is expressed with **explicit, per-transport** attributes on the
request type. Each transport is opt-in and declared independently:

- `[HttpEndpoint("POST", "/api/v{version}/orders")]` — expose over Minimal API for each active version.
- `[HttpEndpoint("POST", "/orders")]` — expose over Minimal API for each active version; the host
configures the common prefix once with
`MapArkEndpointsFromAssembly<T>(versionPrefix: "/api/v{version}")`.
Existing templates containing `{version}` remain authoritative for migration.
- `[GrpcMethod]` (optionally `[GrpcMethod("CreateOrder")]`) — expose as a
code-first gRPC method; defaults to the contract type name. `[GrpcService("Orders")]` groups the service.
- `[RebusMessage(OwnerQueue = "orders")]` — expose as a Rebus message and,
Expand Down
2 changes: 1 addition & 1 deletion docs/mediator-framework/progress/tasks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ recent security commits `8502585`, `fd4d600`, `938567d`, and `c0fc361`.
[x] [DOC-01](docs/DOC-01-user-documentation.md)
8. Additional pre-release improvements:
[x] [FW-10](framework/FW-10-remove-http-auth-metadata.md)
[ ] [FW-11](framework/FW-11-configure-version-prefix-at-mapping.md)
[x] [FW-11](framework/FW-11-configure-version-prefix-at-mapping.md)
[ ] [GEN-11](generator-dx/GEN-11-rename-http-binding-attributes.md)
[ ] [GEN-12](generator-dx/GEN-12-evolvable-enums.md)
9. Future improvements:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FW-11 — Configure the version route prefix at mapping time

**Status**: Draft · **Category**: framework · **Priority**: Post-release
**Status**: Completed · **Category**: framework · **Priority**: Post-release

## Problem

Expand All @@ -16,9 +16,9 @@ preserving contract-local route fragments and generated version expansion.

## Acceptance

- [ ] Add a mapping configuration option for the version prefix.
- [ ] Apply it consistently to generated HTTP routes and OpenAPI documents.
- [ ] Define precedence and migration behavior for explicit prefixes.
- [ ] Add generator and integration tests.
- [ ] `dotnet build Ark.Tools.slnx --configuration Debug` succeeds.
- [ ] `dotnet test Ark.Tools.slnx --no-build --configuration Debug --minimum-expected-tests 1` passes.
- [x] Add a mapping configuration option for the version prefix.
- [x] Apply it consistently to generated HTTP routes and OpenAPI documents.
- [x] Define precedence and migration behavior for explicit prefixes.
- [x] Add generator and integration tests.
- [x] `dotnet build Ark.Tools.slnx --configuration Debug` succeeds.
- [x] `dotnet test Ark.Tools.slnx --no-build --configuration Debug --minimum-expected-tests 1` passes.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ CONTRACT GetAuditsQuery.ToTimestamp : Instant?
CONTRACT GetAuditsQuery.UserId : string?
CONTRACT GetDocumentQuery -> IArkAttachment [group=Ark] [grpc-group=GeneratedDocuments] [http=GET /api/v{version}/greeting-cards/{id}/download] [version=1+] [grpc=Download] [grpc-version=1+]
CONTRACT GetDocumentQuery.Id : Guid
CONTRACT GetGreetingQuery -> GreetingResponse [group=Ark] [grpc-group=Greetings] [http=GET /api/v{version}/greetings/{id}] [version=1-1] [grpc=GetGreeting] [grpc-version=1-1]
CONTRACT GetGreetingQuery -> GreetingResponse [group=Ark] [grpc-group=Greetings] [http=GET /greetings/{id}] [version=1-1] [grpc=GetGreeting] [grpc-version=1-1]
CONTRACT GetGreetingQuery.Id : Guid
CONTRACT GetGreetingV2Query -> GreetingResponseV2 [group=Ark] [grpc-group=Greetings] [http=GET /api/v{version}/greetings-v2/{id}] [version=2+] [grpc=GetGreeting] [grpc-version=2+]
CONTRACT GetGreetingV2Query.Id : Guid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public sealed record GreetingCreatedNotification : ICommand
/// so the generator exposes it as an HTTP GET (a query is a read, not a bus message).
/// </summary>
[Versioning(Introduced = 1, Retired = 2)]
[HttpEndpoint("GET", "/api/v{version}/greetings/{id}")]
[HttpEndpoint("GET", "/greetings/{id}")]
[GrpcMethod("GetGreeting")]
[GrpcService("Greetings")]
[ProtoContract]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ public void Configure(IApplicationBuilder app)
app.UseEndpoints(endpoints =>
{
// Source-generated endpoints for the selected [HttpEndpoint] contracts.
endpoints.MapArkEndpointsFromAssembly<global::Ark.MediatorFramework.Sample.Application.RefreshGreetingCommand>();
endpoints.MapArkEndpointsFromAssembly<global::Ark.MediatorFramework.Sample.Application.RefreshGreetingCommand>(
versionPrefix: "/api/v{version}");
endpoints.MapArkGrpcServicesFromAssembly<global::Ark.MediatorFramework.Sample.Application.RefreshGreetingCommand>();
endpoints.MapGrpcService<DocumentsGrpcService>();
endpoints.MapCodeFirstGrpcReflectionService().AllowAnonymous();
Expand Down
Loading
Loading