mswjs / data

Data modeling and relation library for testing JavaScript applications.

Home Page:https://npm.im/@mswjs/data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using zod to generate table schema

salehi-hassan opened this issue · comments

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)