Description
Description
There had been multiple requests about allowing awaiting promises during transformation. This issue is the tracking issue for the feature.
Proposed solution
Our API is currently sync and doesn't support async operations. The main requirements for the feature should be:
- adding async support should not decrease the performance of sync only validation
- users using sync only validation should not deal with async operations (so no unified
Promise
only response) - some form of timeout should be supported for async validation
We have multiple options to implement this:
- we can introduce an option to the validation methods which signals an async validation, in that case a Promise should be returned
- we can duplicate the API surface and create a
fnAsync
method for all validation method
Questions
How to handle promises in sync validation?
Generally, I think Promises in sync mode should be converted to undefined
. However, we may want to add a transformation option that forbids promises in sync validation. This can be useful for users who use both methods.
to be continued... this issue will be expanded with more implementation details before work starts
Please do not comment non-related stuff like +1
or waiting for this
. If you want to express interest you can like the issue.