zod-wretch
is a small utility library for elbywan/wretch to bring in first-class support for zod schema validation.
import { ZodAddon } from 'zod-wretch';
import wretch from 'wretch';
const api = wretch().addon(ZodAddon);
// ...
const TestSchema = z.object({
message: z.string(),
});
const response = await api.get("/test").jsonSchema(TestSchema);