Closed SimonGeering closed 4 years ago
I think this is a great idea and a good way to make contributing to the project easier for people to step into.
Mulling over the idea in my head, I'm thinking this would work very nicely for the code for various plugins. For example, if there's one for establishing a custom channel currency (for those who want something different than the now built-in channel points), there would absolutely be some validation rules around commands that give/take currency both as a normal user and as a moderator.
Is there a good candidate for a first Validator by way of example that could be included with a PR for this issue. That way we could get the package in along with an example validator and associated unit test.
Not many of the features are in yet, but my guess would be that commands would make for a good first candidate to have validation in place.
Thanks, now that PRs are up to date I'll take a look at this next.
A question for discussion
If the app were to adopt FluentValidation as the main validation mechanism for MediatR requests and other object validation rules, then it would be possible for @benrick to create validation rules on stream and then solicit volunteer help to add unit tests for them afterwards, using the validator as a specification.
If desired, it is also possible to integrate validators into the MediatR pipeline - See https://softdevben.blogspot.com/2017/12/using-mediatr-pipeline-with-fluent.html