Mongoose 8.7.2 breaks Union Types #15057
Labels
has repro script
There is a repro script, the Mongoose devs need to confirm that it reproduces the issue
typescript
Types or Types-test related issue / Pull Request
Milestone
Prerequisites
Mongoose version
8.7.2
Node.js version
22
MongoDB server version
6.11
Typescript version (if applicable)
5.7.2
Description
Before 8.7.2, only the type of the union was returned and that was fine. But now the type is returned as binary, but the union has no binaries in it.
It does not matter that the correct union value is not parsed here by mongoose, as this is done by zod.
This error seems to be related to this issue: #14974
Steps to Reproduce
doSomeThing
returns errorExpected Behavior
No response
The text was updated successfully, but these errors were encountered: