fabian-hiller / valibot

The modular and type safe schema library for validating structural data 🤖
https://valibot.dev
MIT License
5.88k stars 181 forks source link

issue - recursive schema seems to produce incomplete Issues #724

Closed cateland closed 1 month ago

cateland commented 1 month ago

Minimal reproduction case found here > https://playcode.io/1940581

Using recursive Schema i expected to have clear issues generated with a path. Alas it is undefined in the linked case. It seems also to impede the flatten function to produce meaningful resulsts.

fabian-hiller commented 1 month ago

I recommend to use variant instead of union. Checkout this playground and have a look at this guide for more details.

cateland commented 1 month ago

@fabian-hiller thanks a lot will keep you posted !

cateland commented 1 month ago

Everything is awesome thank you, missed the use of variant for this case.