commonbaseapp / zodex

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

Add support for zod lazy and recursive zod schema #23

Open jadedevin13 opened 1 week ago

brettz9 commented 1 week ago

This is exciting to see... Could you:

  1. Run prettier --write src on the code? Besides enforcing the pre-existing style pattern, it should make the diffs easier to read.
  2. Add some tests? (ideally so that npm test shows perfect coverage (besides ui.ts))
  3. Remove the two relevant caveats from the README which reference lazy and recursive schemas
Gregoor commented 1 week ago

Great, thank you! It’s too long to review on my phone, so I’ll try to remember to look at it next week when I’m at my laptop again

brettz9 commented 1 week ago

@Gregoor : I've added #29 as an alternative to this PR. It avoids requiring id on each subobject, instead doing its own internal tracking of paths. It also uses JSON references as the pointers which, besides being familiar to JSON Schema and other users, can optionally be processed first with another JSON references-aware library to allow modular storage of schemas in other files.