commonbaseapp / zodex

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

Custom schemas/refinements #15

Closed brettz9 closed 1 day ago

brettz9 commented 1 year ago

Just a heads up that I'd hope we could add a mechanism for refinements/customs schemas at some point.

However, I think this would be blocked by https://github.com/colinhacks/zod/issues/2515

rebeccaEller commented 2 months ago

Named Superrefinements whould be possible with a functionsdictionary have tested it on the deserialization branch

looks like that: grafik

If you are interessed i can make a pull request

brettz9 commented 2 weeks ago

Named Superrefinements whould be possible with a functionsdictionary have tested it on the deserialization branch

looks like that: grafik

If you are interessed i can make a pull request

Looks to me to be a very good solution, at least if Zod is not going to support named effects so as to avoid the need for passing options to zerialize...

brettz9 commented 1 week ago

@rebeccaEller Do you think you could submit a PR?