-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
Hi @astahmer,
Sorry for 2 issues in one day 🥲
I would like to use this library because of the runtime validation support (zod mainly) it provides.
Based on this from README
you can also generate a client with runtime validation using one of the following runtimes
I would expect that the generated ApiClient actually uses these zod schemas and parse the response with them, but it looks like it's note the case.
See the generated GET request here. It never uses the generated zod schema.
// <ApiClient.get>
get<Path extends keyof GetEndpoints, TEndpoint extends GetEndpoints[Path]>(
path: Path,
...params: MaybeOptionalArg<z.infer<TEndpoint['parameters']>>
): Promise<z.infer<TEndpoint['response']>> {
return this.fetcher('get', this.baseUrl + path, params[0]) as Promise<
z.infer<TEndpoint['response']>
>;
}
// </ApiClient.get>
Am I missing something ? Or are we just supposed to use the generated zod schemas on our own (if so, why not directly use them in the ApiClient ?)
Thanks for your help!
dromzeh and BalogunofAfrica
Metadata
Metadata
Assignees
Labels
No labels