feat(mediator): configure version prefix at mapping - #812
Merged
Conversation
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
AndreaCuneo
July 31, 2026 12:28
View session
AndreaCuneo
requested changes
Jul 31, 2026
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds mapping-level configuration for the common versioned route prefix in the Minimal API generator, enabling contracts to use prefix-free templates while keeping explicit {version} templates authoritative for migration.
Changes:
- Extend generated
MapArkEndpointsFromAssemblyto accept an optionalversionPrefixand centralize route materialization viaVersionedRoute(...). - Migrate sample contract(s) and docs to demonstrate prefix-free route templates with mapping-time prefix configuration.
- Expand generator/test coverage for configured prefixes, explicit
{version}templates, and invalid prefix diagnostics.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/Ark.Tools.MediatorFramework.Tests/GeneratorSnapshotTests.cs | Updates assertions for new route materialization and adds coverage for mapping-time prefix + invalid prefix diagnostics. |
| src/mediator-framework/Ark.Tools.MediatorFramework.MinimalApi/HttpEndpointAttribute.cs | Updates attribute documentation to reflect prefix-free templates as a supported option. |
| src/mediator-framework/Ark.Tools.MediatorFramework.MinimalApi.Generators/MinimalApiEndpointGenerator.cs | Implements versionPrefix plumbing + VersionedRoute helper and adds compile-time diagnostic for invalid prefix constants. |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.WebInterface/SampleStartup.cs | Demonstrates configuring versionPrefix at mapping time. |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.Application/GreetingContracts.cs | Migrates a sample HTTP route to a prefix-free template. |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.Application/ArkApiSurface.txt | Updates sample API-surface snapshot to match the migrated contract template. |
| docs/mediator-framework/progress/tasks/README.md | Marks FW-11 as completed in the task tracker. |
| docs/mediator-framework/progress/tasks/framework/FW-11-configure-version-prefix-at-mapping.md | Updates FW-11 status and acceptance checklist to completed. |
| docs/mediator-framework/design.md | Updates design guidance to recommend prefix-free templates + mapping-time versionPrefix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Versioned HTTP contracts repeated the common
/api/v{version}/route prefix. This adds mapping-level configuration while preserving existing explicit route templates.versionPrefixtoMapArkEndpointsFromAssembly.{version}templates as authoritative for migration.