Skip to content

Added ValidationResult as possible validation result#2332

Merged
jeremydmiller merged 2 commits intoJasperFx:mainfrom
LodewijkSioen:Structured-Validation-Result
Apr 6, 2026
Merged

Added ValidationResult as possible validation result#2332
jeremydmiller merged 2 commits intoJasperFx:mainfrom
LodewijkSioen:Structured-Validation-Result

Conversation

@LodewijkSioen
Copy link
Copy Markdown
Contributor

@LodewijkSioen LodewijkSioen commented Mar 20, 2026

I love the new Lightweight Validation with String Messages, but I was missing the possibility to add a key to group the validation messages. The ValidationOutcome type adds this functionality.

Use Case

I like to use data annotations for pure input validation like required or string length. Actual business validation goes into the Validate methods and are bespoke for that handler. For example: the check if a username is already taken. I would like to be able to communicate back to the client what field caused the Validation Error. Hence the ValidationOutcome type.

Remarks

  • I've added some documentation, but did not run mdsnippets since that changes all the files.
  • wolverine.sln doesn't seem to work because of the missing Wolverine.SourceGeneration project

@LodewijkSioen LodewijkSioen force-pushed the Structured-Validation-Result branch from 73f7f4b to d6070c0 Compare April 3, 2026 07:57
@LodewijkSioen LodewijkSioen marked this pull request as ready for review April 3, 2026 08:06
@jeremydmiller jeremydmiller merged commit 52eed4a into JasperFx:main Apr 6, 2026
17 of 19 checks passed
@LodewijkSioen LodewijkSioen deleted the Structured-Validation-Result branch April 6, 2026 15:16
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.

2 participants