Skip to content

Move validation into Application and replace MediatR with Mediator - #10

Merged
stphnwlsh merged 3 commits into
mainfrom
feature/application-validation
Oct 27, 2026
Merged

stphnwlsh merged 3 commits into
mainfrom
feature/application-validation

Conversation

@stphnwlsh

@stphnwlsh stphnwlsh commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Application and its tests now match CleanMinimalApi: validators for every command and query live in Application and run through a ValidationBehaviour, and Mediator 3.0.2 replaces MediatR 11.
  • Presentation hosts the Mediator source generator and registers it with a scoped lifetime.
  • The Presentation validators were registered but never run. They are removed, along with the request models only they used.
  • Tools drop their try/catch blocks. A single call-tool filter returns MCP error results: Validation Failed: <field>: <message>, Not Found: <message>, or a generic error that no longer leaks the exception message.
  • Integration tests now check the exact validation and not-found results, and the filter has unit tests.

Includes the commit from #9, which drops out once that merges.

CodeQL flags each undisposed CancellationTokenSource. Create them with
a using declaration instead.
Application now matches CleanMinimalApi: validators and a
ValidationBehaviour live in Application, and Mediator replaces MediatR 11.
The unused Presentation validators and request models are removed. Tools
drop their try/catch blocks and a single call-tool filter maps validation,
not-found and unexpected errors to MCP error results without leaking
exception messages.
@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.72%. Comparing base (afa2f40) to head (e4e87e7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #10   +/-   ##
=======================================
  Coverage   99.71%   99.72%           
=======================================
  Files          39       42    +3     
  Lines         356      358    +2     
  Branches        8       11    +3     
=======================================
+ Hits          355      357    +2     
  Partials        1        1           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stphnwlsh
stphnwlsh merged commit 24078b3 into main Oct 27, 2026
12 checks passed
@stphnwlsh
stphnwlsh deleted the feature/application-validation branch October 27, 2026 20:20
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.

1 participant