Skip to content

feat(mediator): configure version prefix at mapping - #812

Merged
AndreaCuneo merged 5 commits into
masterfrom
copilot/proceed-with-next-task
Jul 31, 2026
Merged

feat(mediator): configure version prefix at mapping#812
AndreaCuneo merged 5 commits into
masterfrom
copilot/proceed-with-next-task

Conversation

Copilot AI commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Versioned HTTP contracts repeated the common /api/v{version}/ route prefix. This adds mapping-level configuration while preserving existing explicit route templates.

  • Generated routing
    • Add optional versionPrefix to MapArkEndpointsFromAssembly.
    • Apply prefixes to versioned resource routes during version expansion.
    • Preserve explicit {version} templates as authoritative for migration.
  • Sample and documentation
    • Migrate a sample contract to a prefix-free resource route.
    • Update OpenAPI/API-surface documentation.
  • Coverage
    • Add generator coverage for configured and explicit prefixes.
    • Add sample OpenAPI integration coverage.
endpoints.MapArkEndpointsFromAssembly<RefreshGreetingCommand>(
    versionPrefix: "/api/v{version}");

Copilot AI and others added 4 commits July 31, 2026 11:57
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>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Copilot AI requested a review from AndreaCuneo July 31, 2026 12:46
@AndreaCuneo
AndreaCuneo marked this pull request as ready for review July 31, 2026 13:26
@AndreaCuneo
AndreaCuneo requested a review from a team as a code owner July 31, 2026 13:26
Copilot AI review requested due to automatic review settings July 31, 2026 13:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 MapArkEndpointsFromAssembly to accept an optional versionPrefix and centralize route materialization via VersionedRoute(...).
  • 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.

@AndreaCuneo
AndreaCuneo merged commit dfdb079 into master Jul 31, 2026
8 checks passed
@AndreaCuneo
AndreaCuneo deleted the copilot/proceed-with-next-task branch July 31, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants