Replies: 3 comments 1 reply
-
|
I would find this useful -- one thing I do in my project that I'd rather not have to do manually is parse/validate query params from a URL that need to correspond to known enum values that I have orval codegenned types for (but not zod schemas that could help me do the parsing/validating). Just digging around the repo to see if there's anything existing I could leverage. |
Beta Was this translation helpful? Give feedback.
-
|
Wouldn't this be solved by just doing something like: export async function performLogin(loginData: z.infer<typeof loginFormSchema>) |
Beta Was this translation helpful? Give feedback.
-
|
Definitely think this would be useful. As @devraj says, you can "solve" this by just using export const ontology = z.object({
id: z.string(),
type: z.string(),
name: z.string(),
description: z.string(),
series: z.string(),
});
export type Ontology = z.infer<typeof ontology>;Orval replaces the first declaration there, but I still have to write out the second. Is it the biggest deal to still manually write the It'd be great to have a bit more flexibility with how Orval exports things. Though as a package maintainer myself, I also respect that that can be a pandora's box. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Should Orval output Zods schema for the Types as well?
Does anyone else think this could be useful?
Beta Was this translation helpful? Give feedback.
All reactions