Skip to content

feature: allow awaiting Promises on properties  #549

Open
@NoNameProvided

Description

@NoNameProvided

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.

Metadata

Metadata

Labels

flag: needs discussionIssues which needs discussion before implementation.type: featureIssues related to new features.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions