1.0.1 • Published 11 months ago
zod-wretch v1.0.1
Zod Wretch
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);