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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions