Closed ahkhanjani closed 9 months ago
Hi there. It would be an amazing DX improvement to have a Zod schema out of the box to make sure the response we're getting matches our expectations and also get types in TypeScript. This is everything needed to implement it:
// import { z } from 'zod'; export const DailyResponseSchema = z.object({ id: z.string(), name: z.string(), api_created: z.boolean(), privacy: z.enum(['public', 'private']), url: z.string().url(), created_at: z.string().datetime(), config: z.object({ exp: z.number().int(), // ... }), });
And adding Zod as an optional dependency in package.json.
res.json()
Thank you
Feature request
Hi there. It would be an amazing DX improvement to have a Zod schema out of the box to make sure the response we're getting matches our expectations and also get types in TypeScript. This is everything needed to implement it:
And adding Zod as an optional dependency in package.json.
Why you need this
res.json()
through the validator instead of getting "any" and ESLint errors.Thank you