Validators should throw an exception when async rules are executed synchronously
See original GitHub issueAt the moment if a validator contains async rules and is executed with Validate
, all the rules will be silently be executed synchronously instead. This is not good behaviour.
2 Options:
-
Change the default behaviour for 9.0 so that this generates an exception, forcing
ValidateAsync
to be called instead. This should be an opt-out behaviour so the current behaviour can be maintained (controllable by a switch which should generate a warning). This is the easiest change, but generates a runtime error which is non-obvious. -
Remove all async methods from
AbstractValidator
, and instead have an explicitAsyncAbstractValidator
. This is a very large piece of work, and is a bigger breaking change for users too. But this will be a compile time error, so much easier to spot.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (6 by maintainers)
Top GitHub Comments
Moving this out of the 9.0 release.
Superceded by #1481