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

zodios WIP #1000

Closed
wants to merge 1 commit into from
Closed

zodios WIP #1000

wants to merge 1 commit into from

Conversation

dhess
Copy link
Member

@dhess dhess commented Jul 4, 2023

zodios looks like a potentially interesting replacement for Orval, because it can generate Zod schemas for your API's types [*], and because it appears to have excellent TypeScript type inference support. While developing this PR, I got really nice help in my editor when using its API hooks.

Unfortunately, as far as I can tell, it's also completely unusable for us in its current state, because it doesn't seem to support late binding of parameters to its React Query hooks. It sounds like this will be addressed in v11:

I've pushed this WIP branch to keep track of the work I've done thus far, in the hopes we can revisit zodios once the new version is released.

[*] I think that Orval can generate Zod schemas for your API, as well, but you wouldn't know it, because it's not covered anywhere in its documentation, which is my primary complaint about Orval and one of the reasons I'm looking for alternatives.

It doesn't appear to handle recursive types well, or at least, the
openapi-zod-client generator doesn't (produces types that TypeScript
complains about having `any` type).
@dhess dhess marked this pull request as draft July 4, 2023 13:04
@dhess
Copy link
Member Author

dhess commented May 4, 2024

I'm closing this PR. Zodios hasn't been updated in a long time and appears to be abandoned. Meanwhile, Orval appears to have Zod support now as documented here: https://engineering.kablamo.com.au/posts/2024/orval-and-zod-for-contract-testing/contract-testing-using-playwright/

@dhess dhess closed this May 4, 2024
@dhess dhess deleted the dhess/zodios branch May 4, 2024 22:03
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.

1 participant