Open absynce opened 10 years ago
It seems that the next versions will always handle model validation with a callback, therefore will fix your problem. The issue you're having is because if the model's async validation is skipped, the "async" mode is never set and the validation result is returned instead of the callback being called.
Follow up with issues #378 and #362.
When using the
if
option on an async validation, the asyncisValid
does not call the callback.Example User model:
The following code does not call the isValid callback:
One could argue it's unnecessary to have this attribute on a custom async validation because the properties could be checked within the validation method (which is what I ended up doing to get around the issue), but it should then be ignored or at least documented so people are aware.