Skip to content

Add external validator support#92

Open
DamianEdwards wants to merge 2 commits into
mainfrom
copilot/pr67-external-validators-redesign
Open

Add external validator support#92
DamianEdwards wants to merge 2 commits into
mainfrom
copilot/pr67-external-validators-redesign

Conversation

@DamianEdwards
Copy link
Copy Markdown
Owner

Replaces #67 with a revised external-validator implementation targeted for the 0.11.0 milestone.

Summary

  • Adds IValidate<TTarget> and IAsyncValidate<TTarget> for external validators
  • Resolves validators from the IServiceProvider already accepted by MiniValidator
  • Supports single and IEnumerable<> validator registrations without adding a DI package dependency to the core library
  • Handles nested objects and enumerable elements with external validators
  • Caches delegates without capturing validator instances, preserving transient/scoped behavior
  • Adds documentation and unit coverage for the new API

Validation

  • dotnet test tests\MiniValidation.UnitTests\MiniValidation.UnitTests.csproj -f net8.0 --nologo --verbosity minimal
  • dotnet build src\MiniValidation\MiniValidation.csproj -f netstandard2.0 --nologo --verbosity minimal

Refs #67

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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