Skip to content

fix: context doesn't get passed with async custom validator #480

@dolsem

Description

@dolsem

#292 was closed and locked prematurely.

There were two PRs to fix the issue - #296 and #391. #296 was merged, but unfortunately it doesn't fix the bug that results in context not being passed when validation is performed asynchronously.

If you put async in the beginning of the following line

validate(value: any, args: ValidationArguments) {

the test will fail with TypeError: Cannot read property 'isLongerThan' of undefined.

#391 was based on #296, but it did fix this bug (there was a test case included for that).

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: done/releasedIssue has been completed, no further action is needed.type: fixIssues describing a broken feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions