Southclaws / supervillain

Converts Go structs to Zod schemas
MIT License
76 stars 6 forks source link

Add option to require custom schema definitions #11

Closed josiah-tt closed 9 months ago

josiah-tt commented 9 months ago

When a type implements custom JSON marshalling, the autogenerated zod schema is very likely wrong. The new option WithStrictCustomSchemas() (using the functional option pattern) can be used to reject conversion when a type has a MarshalJSON() method but no custom schema.

josiah-tt commented 9 months ago

I think this will run into merge conflicts with #10. If you merge one I'll be happy to rebase the other and update the PR. Let me know what you think!

josiah-tt commented 9 months ago

Rebased and resolved conflicts!