Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integrate ts-to-zod #217

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

riccardos77
Copy link

@riccardos77 riccardos77 commented Jan 28, 2024

This pull request attempts to address the issue #148.
I haven't added the tests yet and I haven't found if there are any guidelines on the quality of contributions.
However, I would kindly like a review to see if I am on the right track.

thank you.

@riccardos77 riccardos77 changed the title Ts-to-zod-integration integrate ts-to-zod Jan 28, 2024
@fabien0102
Copy link
Owner

Very cool! However, as much as I would love to see everybody using zod to validate their API response, I think this feature should be opt-in.

I actually used to have this setup in production, and to avoid any runtime cost, this feature was enabled only in dev & qa.

@riccardos77
Copy link
Author

I've added a responseValidatorEnabled flag between the fetcherOptions to programmatically enable the responseValidator to be executed.
@fabien0102 did you think something similar?
I made a rebase of the latest changes since this branch had been stopped for some time.

@mrsafalpiya
Copy link

+1 This would be very useful for react hook form + zod resolver!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants