commonbaseapp / zodex

The missing zod (de)?serialization library
MIT License
38 stars 5 forks source link

Recursive #29

Open brettz9 opened 1 week ago

brettz9 commented 1 week ago

Recursive schemas via JSON References

feat: support recursive schemas

Closes #13.

Note that there is one (hopefully minor) API risk in that in order to modify schemas in place, I insert a z.lazy() as a placeholder and later modify its _def.getter internal function to the desired getter. (This was necessary because I had to wait to iterate the whole structure so that each JSON path could be mapped and the JSON reference successfully resolved.)

brettz9 commented 8 hours ago

This one is now rebased onto main and ready for review.