Preserve single errors through Combine; mint validation failures as validation errors#324
Merged
Merged
Conversation
…res as validation errors
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
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.
Summary
Combinenow matchesZip: a single failed result's original error propagates unwrapped; only 2+ failures aggregate into aValidationError. Previously even one failure was wrapped, turning e.g. aNotFoundinto a 400-mapped validation error downstream.ValidationPipelineBehaviornow mints inner validation errors viaError.Validationinstead of the unrelatedError.Problemfactory (which had zero other src usage and a copy-pasted XML summary, now fixed).Combine/Zipaggregation rule once indocs/articles/result-pattern.md, gave theErrorTypeenum real member docs (with HTTP-mapping intent, coordinated with the parallelVulthil.SharedKernel.Apimapping work), and documented three sharp edges prominently (implicitnull → Result<T>failure, reference-only equality, and theError.Noneinvariant).Resultconstructor'sError.Noneinvariant check from value- to reference-equality, so a custom error that merely looks likeError.None(same empty code/description) can be used as a real failure error.Verification
Vulthil.Results.Tests197/197,Vulthil.SharedKernel.Application.Tests26/26.PublicAPI.Shipped/Unshipped.txtuntouched — no public signature changes.Test plan
dotnet build Vulthil.SharedKernel.slnx— 0 warnings, 0 errorsVulthil.Results.Tests(net10.0) — 197/197 passedVulthil.SharedKernel.Application.Tests(net10.0) — 26/26 passedsrc/, reran, restored)Backport to v1.0: no — behavioral semantics changes are minor-appropriate; ships in 1.1.0.