mswjs / data

Data modeling and relation library for testing JavaScript applications.
https://npm.im/@mswjs/data
MIT License
823 stars 52 forks source link

Using zod to generate table schema #264

Closed salehi-hassan closed 1 year ago

salehi-hassan commented 1 year ago

Hey mswjs/data team,

I'm wondering if you have any plan to bring zod validation into table :) Something like this.

const PostSchema = {
  dto: z.object({
    id: z.string().uuid().describe('primaryKey'),
    title: z.string(),
    body: z.string().optional().nullable()
  })
}
const PostTable = generateTable(PostSchema.dto)