Skip to content

validateSync middleware cycle #16291

Description

@AbdelrahmanHafez

Is this intended or a bug?

schema.pre('validate', () => ++pre);
schema.post('validate', () => ++post);

doc.validateSync(); // pre/post stay 0
await doc.validate(); // pre/post run

doc.validateSync() has a middleware: false option added in #15883 , but there's not validateSync middleware cycle at all right now.
I should either remove the option from the docs/TS, or add a validateSync synchronous middleware akin to init.

Thoughts? @vkarpov15 @hasezoey

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions